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 2 of 2
  1. #1
    New Coder
    Join Date
    Nov 2011
    Posts
    20
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Error? I don't see it...

    Help. I can't figure out what is wrong. It states there is a unexpected t string error on line 22.

    Thanks!

    PHP Code:
    <?php
    //error_reporting(E_ALL);
    //ini_set('display_errors', 1);
    include("lib.php");
    define("PAGENAME""List Item");

        if (isset(
    $_POST['edit'])) {
            
    $id $_POST['id'];
            
    $sql ="select from `items` where `id`='$id'";
            
    mysql_query($sql) or die("MySQL error: ".mysql_error()."");
    * * * * * * * * 
    $query $db->execute("select from `inventory` where `item_id`='$id'");

        }
        if (isset(
    $_POST['clear'])) {
            
    $sql ="delete from `items`";
            
    mysql_query($sql) or die("MySQL error: ".mysql_error()."");
        }
        
        
    $bg 1;
        
    $spellquery $db->execute("SELECT * FROM `items` ORDER BY `name`") or trigger_error("query failed: ".mysql_error());
        while (
    $spellrow $spellquery->fetchrow()) {
            if (
    $bg == 1) { $page .= "<div style=\"width:98%; background-color:#eeeeee; font-family: tahoma; font-size: 8pt; line-height: 1.4em; color: #0A3549;\"><form method=\"post\"><p><input type=\"submit\" value=\"Edit\" name=\"edit\"> <input type=\"hidden\" name=\"id\" value=\"".$spellrow["id"]."\"> <b>".$spellrow["id"]."</b>: <b>".$spellrow["name"]."</b></p></form></div>\n"$bg 2; }
            else { 
    $page .= "<div style=\"width:98%; background-color:#ffffff; font-family: tahoma; font-size: 8pt; line-height: 1.4em; color: #0A3549;\"><form method=\"post\"><p><input type=\"submit\" value=\"Edit\" name=\"edit\"> <input type=\"hidden\" name=\"id\" value=\"".$spellrow["id"]."\"> <b>".$spellrow["id"]."</b>: <b>".$spellrow["name"]."</b></p></form></div>\n"$bg 1; }*
        }

    echo 
    $page;
    ?>

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Remove all the asterisks you have in there

    Line 12
    * * * * * * * * $query

    Line 23
    $bg = 1; }*
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

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