I have a table with 2 columns
first column is a file id (varchar)
second is date (varchar)
I want to fetch these 2 columns for each record in my table and stick it in a assoc array
I am aiming to put the file id as the key and the date as the value
I am a bit stuck at the moment, as I am changing my code from an indexed array to a assoc array.
here is what I have so far.
function getLiveList(){
$idQuery = "SELECT file_id FROM live_list";
$dateQuery = "SELECT date FROM live_list";
$fileid = mysql_query($idQuery);
$date = mysql_query($dateQuery);
$array = array();
while($row = mysql_fetch_assoc($date)){
$array[$row] = $date;
}
return $array;
}
I know this is wrong but I am on the correct lines im sure!
Here is my error: Warning: Illegal offset type in...