zelig Posted November 23, 2011 Share Posted November 23, 2011 Good morning all! I'm running this function, but for some reason, it's throwing up a blank white screen. I have no idea why. The "echo $query" doesn't return anything, but those fields are all in the table I'm pulling from, so I don't understand what's going on. Any help would be appreciated! Thanks! function attacks() { $query = doquery("SELECT id, name FROM `attacks` ORDER BY name", "attacks"); echo $query; $page = "<b><u>Edit attacks</u></b><br />Click on a attack name to edit it.<br /><br /><table width=\"50%\">\n"; $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"admin_panel.php?do=editattack:".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 2; } else { $page .= "<tr><td width=\"8%\" style=\"background-color: #ffffff;\">".$row["id"]."</td><td style=\"background-color: #ffffff;\"><a href=\"admin_panel.php?do=editattack:".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 1; } } if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No attacks found.</td></tr>\n"; } $page .= "</table>"; admindisplay($page, "Edit attacks"); } Quote Link to comment https://forums.phpfreaks.com/topic/251683-cant-figure-out-why-im-getting-a-blank-screen/ Share on other sites More sharing options...
voip03 Posted November 23, 2011 Share Posted November 23, 2011 can u echo mysql_num_rows? Quote Link to comment https://forums.phpfreaks.com/topic/251683-cant-figure-out-why-im-getting-a-blank-screen/#findComment-1290733 Share on other sites More sharing options...
Pikachu2000 Posted November 23, 2011 Share Posted November 23, 2011 Where and how are you calling that function, and what is the admindisplay() function's code? Quote Link to comment https://forums.phpfreaks.com/topic/251683-cant-figure-out-why-im-getting-a-blank-screen/#findComment-1290734 Share on other sites More sharing options...
zelig Posted November 23, 2011 Author Share Posted November 23, 2011 Figured it out... I forgot to add it to the if (do) bit. It wasn't recognizing that it was supposed to do anything. Thanks guys! Jump started my brain this morning when asking about other functions. *headsdesk* Quote Link to comment https://forums.phpfreaks.com/topic/251683-cant-figure-out-why-im-getting-a-blank-screen/#findComment-1290737 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.