hi,
I am try to learn PHP and MySQL with the help of Larry's excellent book. Most of the time, I find the book easy to follow and I can find the answer I need, however I have now hit a wall!
I want to count the amount of rows in a table that meet a certain criteria and then use this number in a PHP while loop.
My query is -
$SQL_count = SELECT COUNT(*) FROM college_notes WHERE link_code = 'CHES'
and I used this
$result_count = mysqli_query($dbc, $SQL_count);
My problem is that the variable $result_count doesnt seem to be usable. If I use echo to dump it on the screen, i get this -
Catchable fatal error: Object of class mysqli_result could not be converted to string in/home/www
I have also tried using AS to get an alias and $result_count['alais'] but got a message stating that the variable wasnt an array.
Thanks in advance for any help!
Dave