defining an array key and value within a foreach statement

Timster2691

New Member
I have a mysql statement which returns 2 values for each row.Each time I loop through these results, i want to add them to an array.I want one value to be the key, and the other to be the array value.I tried this, but it doesn't seem to work:\[code\]$dataarray[] = $row['id']=>$row['data'];\[/code\]
 
Back
Top