megafu Posted December 15, 2006 Share Posted December 15, 2006 hi everyone ... :) having a little problem with this:i have in my DB somethink like: userID1 userID2 userID3 .. etcand i would like to make a something that puts all thos values in a array so i can use it. [code] for ($id = 0; $id <= $allIDS; $id++) { $realID = $id+1: $userID = "user".$realID ; $myarray[$id] = $row ['$userID']; }[/code]i tried to use whats above. but it did not work .:S dont really understand why, or can find any solution. Reaaallyy need help. thanks . 8) Link to comment https://forums.phpfreaks.com/topic/30720-db-to-array-with-for/ Share on other sites More sharing options...
BillyBoB Posted December 15, 2006 Share Posted December 15, 2006 try [code]$results = mysql_query("SELET * FROM table");$array = mysql_fetch_array($results);[/code] Link to comment https://forums.phpfreaks.com/topic/30720-db-to-array-with-for/#findComment-141578 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.