If I am fetching data from a MySQL database and using a while loop to iterate through the data how would I add each one to array?
$result = mysql_query(\"SEL
my fav is the following;
$result=odbc_exec($conn,$sql);
if ($result) {
while($found_results[] = odbc_fetch_array($result)) { }
array_pop($found_results); //pop off the empty line from while loading
}
you dont need to pop the last line, but it does leave a blank if you omit it. works the same for mysql obviously.