DeanWhitehouse Posted May 9, 2008 Share Posted May 9, 2008 i am using this code $totalCount = "SELECT image_id, COUNT(image_id) FROM hayleyimages GROUP BY image_id "; $rsCOUNT = mysql_query($totalCount, $conn) or die(mysql_error()); $rowCount = mysql_fetch_object($rsCOUNT); echo "$rowCount"; and the echo is the word Object anyone no why?? also this is the code i was told to use "SELECT COUNT (*) as 'Total' FROM mysql.helpkeyword"; mysql is there database name and helpkeyword is there table name this didn't work when i tryed it . is it outdated? Quote Link to comment https://forums.phpfreaks.com/topic/104937-solved-wierd-mysql-count-result/ Share on other sites More sharing options...
DarkWater Posted May 9, 2008 Share Posted May 9, 2008 You obviously don't know what mysql_fetch_object does. =/ $totalCount = "SELECT image_id, COUNT(image_id) AS count FROM hayleyimages GROUP BY image_id "; $rsCOUNT = mysql_query($totalCount, $conn) or die(mysql_error()); $rowCount = mysql_fetch_assoc($rsCOUNT); echo $rowCount['count']; Sigh. Quote Link to comment https://forums.phpfreaks.com/topic/104937-solved-wierd-mysql-count-result/#findComment-537142 Share on other sites More sharing options...
DeanWhitehouse Posted May 9, 2008 Author Share Posted May 9, 2008 i am only doing this , as no one helped on my pagination problem but the step by step tutorial i am following , doesn't seem to work. Quote Link to comment https://forums.phpfreaks.com/topic/104937-solved-wierd-mysql-count-result/#findComment-537146 Share on other sites More sharing options...
DarkWater Posted May 9, 2008 Share Posted May 9, 2008 The tutorial writer must be on some sort of illegal drug. Not even kidding. My code will echo the row count for you. Quote Link to comment https://forums.phpfreaks.com/topic/104937-solved-wierd-mysql-count-result/#findComment-537147 Share on other sites More sharing options...
DeanWhitehouse Posted May 9, 2008 Author Share Posted May 9, 2008 it echos 1, but there are 3 entries in there Quote Link to comment https://forums.phpfreaks.com/topic/104937-solved-wierd-mysql-count-result/#findComment-537148 Share on other sites More sharing options...
DeanWhitehouse Posted May 9, 2008 Author Share Posted May 9, 2008 NOT SOLVED BUT CLOSED Quote Link to comment https://forums.phpfreaks.com/topic/104937-solved-wierd-mysql-count-result/#findComment-537152 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.