My MYSQL & PHP while code is out of memory, when there is only one row

Posted by Sam on Stack Overflow See other posts from Stack Overflow or by Sam
Published on 2010-06-15T11:47:12Z Indexed on 2010/06/15 11:52 UTC
Read the original article Hit count: 174

Filed under:
|
|
|

Hey all, 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.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql