Hi,
I'm new here! 🙂 Looks like a great forum - hope to learn lots here.
I'm currently trying to get a media script to display the most viewed image.
I have worked out a query to do this:
'SELECT * FROM files WHERE category_id = 5 ORDER BY files . views DESC LIMIT 0, 1 ';
However I'm not sure how to get the appropriate values I need into variables. The above query returns 1 entire row and I have to grab several values from that row (eg. filename).
When I get the necessary data into variables I can do things like the following:
<p>Top Viewed Image</p>
<p>
<img src="http://mydomain.com/' . $top_viewed_image . 'jpg '" width="276" height="110" /></p>
I'm just sort of lost a bit, would appreciate any help.
Thanks!