aldaffodil Posted February 23, 2004 Posted February 23, 2004 Hello everyone! I'm hoping there is someone here who knows how to do this. I need to create some lines of code that will count how many rows total there are in the address_book table. Is there an easy way to do this? Basically, I have a for loop that reads each line of the address book for certain criteria. I need it to know how many lines are in the address book so it knows how many times to go through the loop. Thanks in advance!
aldaffodil Posted February 24, 2004 Author Posted February 24, 2004 Can't anyone help me with this? This is the best I have come up with: $address_count_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK); $address_count = tep_db_fetch_array($count_array); $count = $address_count['total']; And it produces this error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/silkwed/public_html/directory/includes/functions/database.php on line 99 What am I doing wrong?
♥ecartz Posted February 24, 2004 Posted February 24, 2004 $address_count = tep_db_fetch_array($address_count_query); Hth, Matt Always back up before making changes.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.