$query=query;
$result=mysql_query($query);
$pd=mysql_result($result);
Notice the zig-zag - $query is first on the left side, then on the right
side, then $result is first on the left side, then on the right side.
Bogdan
Ryan Snow wrote:
Hi, Im kinda new to this list. Can anyone tell me what
PS. You should consider using mysql_fetch_row() or at least
mysql_fetch_array() for perforance reasons.
B
Bogdan Stancescu wrote:
$query=query;
$result=mysql_query($query);
$pd=mysql_result($result);
Notice the zig-zag - $query is first on the left side, then on the
right side, then
: Bogdan Stancescu [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: Ryan Snow [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, February 26, 2002 2:32 PM
Subject: Re: [PHP-DB] variable interpolation in mysql queries
: PS. You should consider using mysql_fetch_row() or at least
: mysql_fetch_array
First of all that should throw an error, correct syntax is mysql_result
($query, 0) meaning to grab the 0 index returned.
I am not sure about performance wise, however I dislike mysql_result
since if nothing is returned then you get a runtime error. Instead I
like to use
list($pd) =
Cool, I didn't know you could embed mysql_query(...) inside
mysql_fetch_row(...). That's kinda nice--I hate having a line each for
1-connecting, 2-selecting, 3-querying, and 4-resulting. I'll hafta try
that. Thanks.
Ryan
On Tue, 26 Feb 2002, Stewart Gateley wrote:
First of all that