captainspi Posted July 17, 2008 Share Posted July 17, 2008 Hi there, Is it possible to extract data from a particular mysql column and store it in an array? Thanks in advance... Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted July 17, 2008 Share Posted July 17, 2008 You'll want something like this: $sql = "SELECT field FROM yourtable"; $result = mysql_query($sql) or trigger_error(mysql_error(),E_USER_ERROR); $array = array(); while($row = mysql_fetch_row($result)){ $array[] = $row[0]; } print_r($array); Quote Link to comment Share on other sites More sharing options...
captainspi Posted July 17, 2008 Author Share Posted July 17, 2008 thanks a lot! Quote Link to comment 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.