Hello,
I am having some problem passing an associative array to a function, and losing the associative incicies for the passed array.
<pre>
// Begin hacky example ...
$res = mysql_query("SELECT * FROM table WHERE ID = $id");
while ($row = mysql_fetch_array($res)) {
view_a_row($row);
}
function view_a_row($row)
{
echo "$row[ID]";
echo "$row[Name]";
echo "$row[Gender]";
}
</pre>
For some reason, in certain situations, this will not work, and the associative indicies are lost. Has anyone else experienced this, and if so, what am I doing wrong.
Any help or pointers would be welcomed
Thnaks
Chris