Thank you very much, David--you understood the problem exactly and your solution worked perfectly!
I'd like to add a comment about mysql_data_seek to the php manual entry on mysql_fetch_row, because I would think that this might be a common problem... Matt ----- Original Message ----- From: David Robley <[EMAIL PROTECTED]> To: GOLD, MATTHEW <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 5:37 AM Subject: RE: [PHP-DB] Re: arrays, variables, and register_globals > So what you want to do is print a field from the first row extracted from the table, then > loop through all the rows and print several fields? I think you want mysql_data_seek. > > Whenever you do a mysql_fetch_row, php grabs the current row from the result set, and > shifts a pointer to the next record in the result set. In this case it seems you need to > print from the first record, then reset the pointer to the first record and print from all > records found. So: > > $row = mysql_fetch_row ($result)) > print ("$row[4]"); > > mysql_data_seek($result, 0); // Add this > > while ($row = mysql_fetch_row ($result)) > > Unless I misunderstand what you are trying to do.... > > Cheers > -- > David Robley > Temporary Kiwi! > Quod subigo farinam > > "I've been to a film festival in the South of France," said Tom cannily. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php