Re: [PHP4BETA] lates libzend update did bad things
| From: | Thies C. Arntzen | Date: | Fri, 03 Sep 1999 12:20:06 +0000 |
| Subject: | Re: [PHP4BETA] lates libzend update did bad things | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-4024@lists.php.net to get a copy of this message | ||
On Fri, 3 Sep 1999, Zeev Suraski wrote:
> At 10:45 03/09/99 , Thies C. Arntzen wrote:
> >zeev, the lates update broke something...
> >
> >
> ><?
> >$conn=mysql_connect("127.0.0.1");
> >
> >for ($inx = 0; $inx < 10; $inx++) {
> > $r = mysql_db_query("test", "select * from phptest");
> > $array = mysql_fetch_array(&$r);
> >// mysql_free_result($r);
> >}
> >echo "-----------------------end--------------\n";flush();
> >?>
> >
> >used to work - now says:
> >PHP Warning: 2 is not a MySQL result index in mysql.php3 on line
> >6
>
> Well, why are you sending the result handle by reference? My API patch
> doesn't make miracles, it keeps the existing C code in a way it would work
> nicely, but not with weirdo stuff like that :) To avoid these errors, you
> would have to actually modify the C code to be PHP 4.0 style (which I will
> today, but I'll only do the MySQL module).
sorry, that was a leftover.. it seems to work without the '&' - but have a
look at #2230 - i have the same problem with some oracle-php-code i've
written.
>
> Basically, mysql_fetch_array() expects to receive a copy of the result
> handle, and it destroys it when it's done with it (transparently,
> mysql_fetch_array() was never designed to do it). Since you now send it
> the actual handle itself and not a copy - the handle that's destroyed is
> the only handle, and the object is dead by the time PHP wants to use it.
hmm got you - i will have a deeper look why my code stopped working this
morning - again, i'm not the only one (#2230) - so some thing has
changed;-)
tc
>
> Zeev
> --
> Zeev Suraski <zeev@zend.com> http://www.zend.com/
> For a PGP public key, finger bourbon@netvision.net.il
>
>
> --
> PHP 4 Beta
>
>
Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!"
Digital Collections Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93 20097 Hamburg / Germany