This may seem to be a stupid question but i cannot get my head around to this... I queried my database with something of the form...
Code: Select all
$SQL = mysql_query("SELECT * FROM cd_users");
$Data = mysql_fetch_array($SQL);
And i now want to display all of the results, my problem is the next thing i usually do when i work with this is i take the result of the query and run mysql_fetch_array() ...now then since the result is in an associative array, now then i would like to loop through each row and display all of the values, but i cannot see how to do this, $k and $v are out of bounds so i figure that i have to make a for statement... then let's say that i have the following information in my table
uid name email other
1 mike hello ...
2 jane abc ....
to loop through the result that i get would i say $Data['name'][0] and that will diplay the first value for name...then $Data['name'][1] would diplay second value in this case jane...
Clearly the output should be
uid name email other
1 mike hello ...
2 jane abc ....
Thanks a bunch, maybe i need sleep but i really can't think this one out...