Results 1 to 3 of 3

Thread: MSSQL error: The name "XXX" is not permitted in this context...

Threaded View

  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    4

    Exclamation MSSQL error: The name "XXX" is not permitted in this context...

    Ok, so now I solved my last issue, but have hit the wall with this one... The following code produces this error:

    MSSQL error: The name "XXX" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.

    PHP Code:
    $sql 'INSERT INTO tbl_jobs VALUES (';
    $sql .= $_POST["company"];
    $sql .= ',';
    $sql .= $_POST["location"];
    $sql .= ',';
    $sql .= $_POST["title"];
    $sql .= ',';
    $sql .= $_POST["desc"];
    $sql .= ',';
    $sql .= $_POST["exper"];
    $sql .= ',';
    $sql .= $_POST["edu"];
    $sql .= ',';
    $sql .= $_POST["link"];
    $sql .= ')'
    In my troubleshooting, I verified that the variables are passing correctly, but it's treating it like a column name (according to the error). According to what I have seen, the syntax looks ok, but again, I am confused. I have googled this, but no luck so far.
    Last edited by mjkomidar; 01-06-2010 at 08:38 AM.

Tags for this Thread

Bookmarks

Bookmarks

Posting Permissions

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