Jump to content


Photo

how to use SELECT COUNT(*) [RESOLVED]


  • Please log in to reply
2 replies to this topic

#1 AdRock

AdRock
  • Members
  • PipPipPip
  • Advanced Member
  • 911 posts

Posted 06 September 2006 - 07:21 PM

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 1 of 26

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

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

If your topic has been solved, please mark the topic as SOLVED.

This helps others from identifying which topics need help still

#2 sasa

sasa
  • Staff Alumni
  • Advanced Member
  • 2,804 posts
  • LocationHrvatska

Posted 06 September 2006 - 07:30 PM

try
echo $count1 = mysql_result($count,0,0);


#3 AdRock

AdRock
  • Members
  • PipPipPip
  • Advanced Member
  • 911 posts

Posted 06 September 2006 - 07:52 PM

Thanks sasa

I just added your code to my echo to make

echo ($page." of ".$count1 = mysql_result($count,0,0));

and now it works
If your topic has been solved, please mark the topic as SOLVED.

This helps others from identifying which topics need help still




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users