Hi All, I am trying to get the results of a function, which queries MySQL, back into an array for me to order. I only want to print out certain fields (I call the same query, but use different fields in different places).
This works is I print out the fields in the function itself: while($row = mysql_fetch_array($result)) { echo $row["id"] . "<br>"; } This however prints out an unending list of values: /* This is where I think it's getting messed up, since it doesnt seem to be able to store the "query" in a variable. I suspect it's something to do recursive and multi-dimension arrays http://www.phpbuilder.com/manual/language.types.array.php*/ $mysql_query = mysql_fetch_array($result); while($row = $mysql_query) { echo $row["id"] . "<br>"; } Can someone perhaps show me how to do it (or point me in the right direction), since I need to do this: function ReturnSQLResults() { .................... $mysql_query = mysql_fetch_array($result); return $mysql_query; } And then be able to just print the fields I require. Thanks in advance!!! Terence -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php