[Solved!] - HELP!: mysql result from COUNT(*) query - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: [Solved!] - HELP!: mysql result from COUNT(*) query (/showthread.php?tid=2300) |
[Solved!] - HELP!: mysql result from COUNT(*) query - El Forum - 07-28-2007 [eluser]gunter[/eluser] I want know how many rows have parentid = '38'... Code: $sql = "SELECT COUNT(*) FROM s3album WHERE parentid = '38'"; Code: stdClass Object ( [COUNT(*)] => 2 ) how can I get the result? with echo $result->????? [Solved!] - HELP!: mysql result from COUNT(*) query - El Forum - 07-28-2007 [eluser]座頭市[/eluser] Try this: Code: $sql = <<<ENDSQL [Solved!] - HELP!: mysql result from COUNT(*) query - El Forum - 07-28-2007 [eluser]gunter[/eluser] Yippie! :-) Thanks!!!! Thats it! [Solved!] - HELP!: mysql result from COUNT(*) query - El Forum - 07-29-2007 [eluser]Crafter[/eluser] You could lose the LIMIT clause without a performance impact. |