MySQL & PHP while code is out of memory, when there is only one row -


Why this code is throwing out of memory error, when there are only 1 row in the database ..

< Pre> $ request_db = mysql_query ("Select SELECT * requests where = '0'") or die (mysql_error ()); $ Request = mysql_fetch_array ($ request_db); Echo "& lt; table border = \" 1 \ "align = \" center \ "& gt;"; While ($ request ['triggered'] == "0") {resonates "<"> ; Echo $ request ['SongName']; Echo "& lt; / td> & lt; td & gt;"; Echo "& lt; tr & gt; & lt; td & gt;"; Echo $ request ['artist']; Echo "& lt; / td> & lt; td & gt;"; Echo "& lt; tr & gt; & lt; td & gt;"; Resonance $ request ['dedicated']; Echo "& lt; / td> & lt; td & gt;"; } Resonates "& lt; / table & gt;";

Thanks.

Hm, to be honest, I do not have to type in while Understand the usage You are getting only one line with this code (even if there is more than one line in DB!). Maybe you tried to do something like (if $ request ['run'] == 0) but it does not matter too much because the query returns rows only with Is 0 .

As far as I can tell, you intend to output one or more rows from the request table where is equal 0 . So what is it more like?

  $ request_db = mysql_query ("from selection to * requests where in = 0 '') or die (mysql_error ()); while ($ request = mysql_fetch_array ($ request_db)) {// Output stuff here ... echo $ request ['SongName'];}  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -