Re: [PHP-DB] mysql_data_seek problem

2005-05-01 Thread Chris
Sorry, two typos, that should; have been:
if(mysql_num_rows($rResult) > 0))  mysql_data_seek($rResult,0);
Chris wrote:
Just add a check of the total returned rows, and seek to 0 only if 
there is 1 or more.

if(mysql_num_rows($rResult) > 1) mysql_data_seek($rResult,0);
Chris
Alvaro Cobo wrote:
Hi all:
I am having problems with the function mysql_data_seek when it refers 
to an array with an empty recordset (for example when the query does 
not returns data), so I keep receiving the following message in the 
browser:
Warning: mysql_data_seek(): Offset 0 is invalid for MySQL result 
index 9 (or the query data is unbuffered) in 
/var/www/intranet/inform/view.php on line 146

I need this function to reset an array to use the same query several 
times in the same page.
Does anybody knows how to avoid this message to be printed?

Thanks a lot.
Alvaro
 


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] mysql_data_seek problem

2005-05-01 Thread Chris
Just add a check of the total returned rows, and seek to 0 only if there 
is 1 or more.

if(mysql_num_rows($rResult) > 1) mysql_data_seek($rResult,0);
Chris
Alvaro Cobo wrote:
Hi all: 

I am having problems with the function mysql_data_seek when it refers to an array with an empty recordset (for example when the query does not returns data), so I keep receiving the following message in the browser: 

Warning: mysql_data_seek(): Offset 0 is invalid for MySQL result index 9 (or 
the query data is unbuffered) in /var/www/intranet/inform/view.php on line 146
I need this function to reset an array to use the same query several times in the same page. 

Does anybody knows how to avoid this message to be printed?
Thanks a lot. 

Alvaro
 

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] mysql_data_seek problem

2005-04-29 Thread Alvaro Cobo
Hi all: 

I am having problems with the function mysql_data_seek when it refers to an 
array with an empty recordset (for example when the query does not returns 
data), so I keep receiving the following message in the browser: 

Warning: mysql_data_seek(): Offset 0 is invalid for MySQL result index 9 (or 
the query data is unbuffered) in /var/www/intranet/inform/view.php on line 146

I need this function to reset an array to use the same query several times in 
the same page. 

Does anybody knows how to avoid this message to be printed?

Thanks a lot. 

Alvaro