Jeff, et al -- ...and then [EMAIL PROTECTED] said... % [quoting me] % % >mysql_fetch_array() returns an array, and I know I want a field from just % >this one row (not looping), could I just % > % > $i = mysql_fetch_array($r)[0] ; % % Hi David.... % How about: % $i = mysql_result(mysql_query($q,$dbro),0);
Well, I *thought* it was perfect. Unfortunately, it ain't in practice.
Running
$r = mysql_query("select ID from customer where EMail = '$email'",$dbro) ;
$row = mysql_fetch_array($r) ;
$id = $row[0] ;
works, but
$id = mysql_result(mysql_query("select ID from customer where EMail =
'$email'",$dbro),0) ;
or even
$r = mysql_query("select ID from customer where EMail = '$email'",$dbro) ;
$id = mysql_result($r,0) ;
fails with
Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 4...
Now this makes some sense; the manual says that
mysql_result ( resource result , int row )
will jump to row $row in the output but says nothing about returning me a
given fields.
Any other thoughts?
% HTH
% Jeff
TIA again & HAND
:-D
--
David T-G
[EMAIL PROTECTED]
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
pgp00000.pgp
Description: PGP signature
