Connecting Tech Pros Worldwide Help | Site Map

buffers od mysql interface

  #1  
Old July 17th, 2005, 11:48 AM
Zbigniew Lisiecki
Guest
 
Posts: n/a
Hi,
the line of SQL code:

********$sql*=*"select*ids*from*idlist*where*lid*= *last_insert_id()";

should get the number of the new inserted row and it works properly when
called directly. but called through php:

******$sql_res*=*mysql_query*($sql,*$connection);

is still ok, but

******$res*=*mysql_fetch_row*($sql_res)

sometimes returns 0, even if mysql_errno() is 0. after some time, or some
trials the error sometimes won't reappear. therefore i expect someting
connected to logging, or freeing some buffers. does anybody have an idea
how to get rid of it, or how to find the true cause.
thanx in aadvance,
zbyszek lisiecki
--
http://zbyszek.evot.org
  #2  
Old July 17th, 2005, 11:48 AM
rw
Guest
 
Posts: n/a

re: buffers od mysql interface


If i read last inset id using PEAR it newer cause me amy problem. Mybe
look on pear source or maybe use this
http://pl2.php.net/manual/en/functio...-insert-id.php.


--
Robert Was

Zbigniew Lisiecki wrote:[color=blue]
> Hi,
> the line of SQL code:
>
> $sql = "select ids from idlist where lid = last_insert_id()";
>
> should get the number of the new inserted row and it works properly when
> called directly. but called through php:
>
> $sql_res = mysql_query ($sql, $connection);
>
> is still ok, but
>
> $res = mysql_fetch_row ($sql_res)
>
> sometimes returns 0, even if mysql_errno() is 0. after some time, or some
> trials the error sometimes won't reappear. therefore i expect someting
> connected to logging, or freeing some buffers. does anybody have an idea
> how to get rid of it, or how to find the true cause.
> thanx in aadvance,
> zbyszek lisiecki[/color]

--
Robert Was
Closed Thread