jaiffed Posted October 15, 2011 Share Posted October 15, 2011 i want to create array from mysql what is the script for this...? value like $data = array("1" => .0032, "2" => .0028, "3" => .0021, "4" => .0033, "5" => .0034, "6" => .0031, "7" => .0036, "8" => .0027, "9" => .0024, "10" => .0021, "11" => .0026, "12" => .0024, "13" => .0036, "14" => .0028, "15" => .0025); Quote Link to comment https://forums.phpfreaks.com/topic/249171-create-array-from-mysql/ Share on other sites More sharing options...
peterg012 Posted October 15, 2011 Share Posted October 15, 2011 Hi, Are you trying to put this into a mysql table? Thanks Peter Quote Link to comment https://forums.phpfreaks.com/topic/249171-create-array-from-mysql/#findComment-1279578 Share on other sites More sharing options...
jaiffed Posted October 15, 2011 Author Share Posted October 15, 2011 No, I am getting from mysql into array Quote Link to comment https://forums.phpfreaks.com/topic/249171-create-array-from-mysql/#findComment-1279579 Share on other sites More sharing options...
peterg012 Posted October 15, 2011 Share Posted October 15, 2011 Hi, You could do something like: $results = mysql_query("SELECT Field1, Field2 FROM example"); while($row = mysql_fetch_array($results)) { $arr[] = $row->Field1 } Peter Quote Link to comment https://forums.phpfreaks.com/topic/249171-create-array-from-mysql/#findComment-1279580 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.