Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2011
    Posts
    20
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Can't figure out why getting a blank screen...

    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!

    PHP Code:
    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");
        


  • #2
    Senior Coder
    Join Date
    Apr 2010
    Posts
    1,463
    Thanks
    71
    Thanked 103 Times in 102 Posts
    Being in DK structure, this query

    PHP Code:
    $query doquery("SELECT id, name FROM `attacks` ORDER BY name""attacks"); 
    Needs to look like this

    PHP Code:
    $query doquery("SELECT id,name FROM {{attacks}} ORDER BY name""attacks"); 
    Also don't echo the query. Check for value instead.
    Been a sign maker for 7 years. My business:
    American Made Signs

  • #3
    New Coder
    Join Date
    Nov 2011
    Posts
    20
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Ah, gotcha. Figured it out too...

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

    *headsdesk*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •