You can also do
\n";
}
?>
(mysql_fetch_array uses MYSQL_BOTH for the second argument by default, which
returns an array using both numeric and associative keys - that's why you
were getting double results. :))
Per the manual:
--
CTED]>
Sent: Monday, February 04, 2002 8: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
> $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. :)
Ch
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
Ok, could someone tell me why this isn't working?
(note, I took out all my error checks. This is just the
relevant code...
$query = "Query that does return row(s)";
$result = mysql( $dbname, $query );
$macroDataArray = mysql_fetch_array( $result );
for( reset( $macroDataArray ); $elementKey =
5 matches
Mail list logo