This could be the problem in your for loop: $elementKey = key(
$macroDataArray ) - you're using the = assignment operator. Try == or =.
Mike
- Original Message -
From: Chris Boget [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 04, 2002 8:29 AM
Subject: [PHP] Oddity
$macroDataArray = mysql_fetch_array( $result );
I'm still curious what is going wrong, but I've found a work arround.
One of the things I love about PHP is that you learn something new
just about every day. Instead of fetch_array(), I can use fetch_assoc()
and it'll do just what I need. :)
:42 AM
Subject: Re: [PHP] Oddity
$macroDataArray = mysql_fetch_array( $result );
I'm still curious what is going wrong, but I've found a work arround.
One of the things I love about PHP is that you learn something new
just about every day. Instead of fetch_array(), I can use fetch_assoc
You can also do
?
$macroDataArray = mysql_fetch_array($result,MYSQL_ASSOC)
foreach(array_keys($macroDataArray) as $elementkey){
echo Value for key $elementKey = $macroDataArray[$elementKey]br\n;
}
?
(mysql_fetch_array uses MYSQL_BOTH for the second argument by default, which
4 matches
Mail list logo