Hey all. I'm having a little bit of an issue here.
I'll start by showing the code:
function dbq($sql) {
$q = mysql_query($sql);
$row = mysql_fetch_array($q);
return $row;
}
$row = dbq("SELECT * FROM admin");
echo $row['username'];
Above code obviously displays a function that can be used for single database outputs.. But, i wanna use it for multiple data outputs, using a while with this function. Something like:
while($row = dbq("SELECT * FROM admin")) {
echo $row['username'];
echo "<br />";
}
But it returns errors like, either does it display the first row a billion times, or does simply timeout.. How can this be done?
Thanks in advance!