why is this code throwing an out of memory error, when there is only 1 row in the database..
$request_db = mysql_query("SELECT * FROM requests
WHERE haveplayed='0'") or die(mysql_error());
$request = mysql_fetch_array( $request_db );
echo "<table border=\"1\" align=\"center\">";
while ( $request['haveplayed'] == "0" ) {
echo "<tr><td>";
echo $request['SongName'];
echo "</td><td>";
echo "<tr><td>";
echo $request['Artist'];
echo "</td><td>";
echo "<tr><td>";
echo $request['DedicatedTo'];
echo "</td><td>";
}
echo "</table>";
Thanks.
Hm, to be honest, I dont understand the use of
whilein this case. You are only fetching one row with this code (even if there is more then one row in the DB!). Maybe you tried something likeif($request['haveplayed'] == 0)but that wouldnt make too much sense, also, as the query only returns rows withhaveplayedequal0.As far as I can tell, you intend to output one or more rows from the
requeststable wherehaveplayedequals0. Wouldnt it be more like this then?