Lets say I have a mysql database called "pcode" with only one table, called "uk_postcodes" and I want to populate my array with only the first column, called "postcodes". What is missing from the following code:
//link to mysql server
$link = mysql_connect('localhost', 'root', 'root');
mysql_select_db('pcode');
$sql = "SELECT * FROM `ukpostcodes`";
$query = mysql_query($sql);
$var = array();