ODBC, PHP while loop to assign data to array

foxy11

New Member
I want to loop though my query and assign each data field to an array.\[code\] $query ="SELECT * FROM Reservations WHERE Room_ID = '145' "; $result = odbc_exec($connect,$query); while(odbc_fetch_row($result)){ $reservation = odbc_result($result, 1); $reservation2 = odbc_result($result, 2); $reservation3 = odbc_result($result, 3); $reservation4 = odbc_result($result, 4); }\[/code\]What I am trying to do is\[code\]$content = array(); while($info = mysql_fetch_array($result)){$content[] = $info;}\[/code\]I guess I could check to see the total number of rows and then just do a for loop that increments the $result.
 
Top