I am running a query with a while loop that creates an array of the column names
while($ContactLookup_Row = mysql_fetch_array($ContactLookup_Rs)) {
$ContactLookup_Results[] = array(
'sequence'=>$ContactLookup_Row["sequence"],
'forename'=>$ContactLookup_Row["forename"],
'surname'=>$ContactLookup_Row["surname"]
);
}
How can I make the loop add all the column names as their own variables without having to type them all out manually?
Should I put $ContactsLookup_Results[]= array(
before the while loop. And then );
after the while loop
And then I'm not sure about within the loop?
I want it to look like:
'ColumnName'=>$ContactLookup_Row["ColumnName"]
With a , on the end of each one but not the last one