mjkomidar
01-06-2010, 08:32 AM
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.
$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.
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.
$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.