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

2003-07-22 Thread Terry Riley
I think reset() is only for arrays Terry --Original Message- > It worked like a charm. (initially I was trying to use reset() guess it > was > the wrong call) > > One other thing, The 1st call was supposed to get the Column Headers > and the > second to get the results.

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 b

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

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

2003-07-22 Thread Jason Wong
On Tuesday 22 July 2003 18:20, Ow Mun Heng wrote: > 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 Ro