[PHP-DB] WHY need to query 2x to get results

2003-07-22 Thread Ow Mun Heng
Hi, I have a code that goes like this. Scroll down to the -- sign. How come I need another $result = mysql_query($sql) at that location? If I don't have it, the results coming out will only start printing from the 2nd Row.. Omitting the 1st. Results as wanted row 1

Re: [PHP-DB] WHY need to query 2x to get results

2003-07-22 Thread Terry Riley
Because you have already fetched one row before outputting the record count. Therefore the row pointer is at the second record before you 'print out'. Try putting mysql_data_seek($result,0); in place of your second $result = mysql_query($sql); This should return the pointer to the first

RE: [PHP-DB] WHY need to query 2x to get results

2003-07-22 Thread Ow Mun Heng
/M Engineering Western Digital M'sia DID : 03-7870 5168 -Original Message- From: Terry Riley [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 22, 2003 7:33 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] WHY need to query 2x to get results Because you have already fetched one row before