View Full Version : Can't figure out why getting a blank screen...

11-23-2011, 03:46 PM
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!


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");


11-23-2011, 03:52 PM
Being in DK structure, this query

$query = doquery("SELECT id, name FROM `attacks` ORDER BY name", "attacks");

Needs to look like this

$query = doquery("SELECT id,name FROM {{attacks}} ORDER BY name", "attacks");

Also don't echo the query. Check for value instead.

11-23-2011, 04:00 PM
Ah, gotcha. Figured it out too...

Forgot to add it to the if (do) bit...