Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End PHP Syntax Error – Please Help!

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #36848
    schart
    Participant

    I’m basically doing a submit form, and for some extremely irritating reason, it won’t work! I’m inserting values into my database which looks like this:

    id - int(11) primary key auto
    name - varchar(100)
    s_info - varchar(200)
    info - text
    type - varchar(200)
    by - varchar(200)
    published - varchar(50)
    codelink - varchar(500)

    Now here is my form action page: session_start();
    $username = $_SESSION;
    $password = $_SESSION;
    $connect = mysql_connect(“…..”);
    $select_db = mysql_select_db(“…..”, $connect);

    $name = $_REQUEST;
    $s_info = $_REQUEST;
    $info = $_REQUEST;
    $type = $_REQUEST;
    $by = $_REQUEST;
    $codelink = $_REQUEST;

    $published = “no”;
    $category = “usersubmitted”;
    if ($username == “Schart”){
    $category = “original”;
    }

    $insert = mysql_query(“INSERT INTO apps (name, s_info, info, category, type, by, published, codelink) VALUES (‘$name’, ‘$s_info’, ‘$info’, ‘$category’, ‘$type’, ‘$by’, ‘$published’, ‘$codelink’)”);
    if (!$insert){
    die(“Error: ” .mysql_error());
    }
    ?>

    This is the error I get:

    Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by, category) VALUES ('no', 'App', 'Schart Clock', 'A nice clock to add to your ' at line 1

    This is extremely frustrating! Any suggestions? Please help.

    Thank’s :)

Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.