I'm using PHP 5 with mySQL:
$line = mysql_fetch_array($result, MYSQL_ASSOC);
When I do this, I can see the results of the query printed:
foreach ($line as $data)
{
echo ($data . ", ");
}
But if I do this instead:
echo ($line[0] . " " . $line[1] . " " . $line[2]);
I don't see anything. Also I can't assign a value from $line:
$values[] = $line[0]; // fails - doesn't assign anything
Why? And what should I be doing instead?
error_reporting(E_ALL). You would then see someE_NOTICElevel errors about undefined array indexes