Jump to content

Archived

This topic is now archived and is closed to further replies.

AdRock

how to use SELECT COUNT(*) [RESOLVED]

Recommended Posts

I have got my image gallery but i want to display what image number it is on and how many images there are so it appears something like [b]1 of 26[/b]

I am having trouble with the SELECT COUNT bit as it says on the output [b]6 of Resource id #8[/b] 6 being the id number of the image

[code]$page = $_GET['id'];
$count = mysql_query("SELECT COUNT(*) FROM images");
...
...
...
echo($page." of ".$count);[/code]

Share this post


Link to post
Share on other sites
try[code]echo $count1 = mysql_result($count,0,0);[/code]

Share this post


Link to post
Share on other sites
Thanks sasa

I just added your code to my echo to make

[code]echo ($page." of ".$count1 = mysql_result($count,0,0));[/code]

and now it works

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.