789";
"123" == current(explode('#', $str))
The result will be true.
Not sure if this helps you, but worth a shot.
-Original Message-
From: J R [mailto:[EMAIL PROTECTED]
Sent: 10 August 2006 4:54 AM
To: php-db@lists.php.net
Subject: [PHP-DB] Direct Access to an Array Item
Closest you might get is
if ( mysql_result($result,0,3 ) == 'foo') {
$user = $mysql_fetch_row($result);
}
bastien
From: Stut <[EMAIL PROTECTED]>
To: Peter Beckman <[EMAIL PROTECTED]>
CC: PHP-DB Mailing List
Subject: Re: [PHP-DB] Direct Access to an Array Item?
On 8/9/06, Peter Beckman <[EMAIL PROTECTED]> wrote:
I want to access a variable within a function-returned array without
setting the array to a variable first. Example -- test for equal to
string
'foo' on the 4th element of a returned fetch row:
if (($row = mysql_fetch_row($result))[3] ==
Peter Beckman wrote:
> if (($row = mysql_fetch_row($result))[3] == 'foo') {
> $user = $row;
> }
>
> or
>
> $bar = explode('#', $str)[2];
PHP does not currently support this type of syntax in any form. You must
assign the return value of a function to a variable if you want to
On 8/9/06, Peter Beckman <[EMAIL PROTECTED]> wrote:
I want to access a variable within a function-returned array without
setting the array to a variable first. Example -- test for equal to
string
'foo' on the 4th element of a returned fetch row:
if (($row = mysql_fetch_row($result))[3] ==
On Wed, 9 Aug 2006, Bastien Koert wrote:
use mysql_result
mysql_result ( $result, 0, 2 )
where 2 is the offset of the fields in the row
In one line of code, I want to fetch the row into a variable, and test a
variable within that row.
I want to know how to do this both within a DB query
use mysql_result
mysql_result ( $result, 0, 2 )
where 2 is the offset of the fields in the row
Bastien
From: Peter Beckman <[EMAIL PROTECTED]>
To: PHP-DB Mailing List
Subject: [PHP-DB] Direct Access to an Array Item?
Date: Tue, 8 Aug 2006 22:34:55 -0400 (EDT)
I want to access a va
I want to access a variable within a function-returned array without
setting the array to a variable first. Example -- test for equal to string
'foo' on the 4th element of a returned fetch row:
if (($row = mysql_fetch_row($result))[3] == 'foo') {
$user = $row;
}
or
$bar = e