$qid = db_query(" SELECT aid FROM clog WHERE (ip ='$ip') "); $i=1; while ($row = mysql_fetch_row($qid)) { $p[$i] = $row[0]; $i++; } print_r($p);
Is there any better way to store a set of sql results into a php array?
xeelee😃
Well, that's the general idea. Should declare the array first, and you could drop the counter, unless you need it to start at 1 instead of zero.
$p = array(); while ($row = mysql_fetch_row($qid)) { $p[] = $row[0]; }
Thanks LordShryku 🙂
think will be using your code from now on...