Hello all. I keep getting a syntax error on the following SQL. Here is the error first:
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 'condition, year, make, model, edition, engine, doors, bodyStyle, interiorType, i' at line 1
Here is the SQL:
$SQL = "INSERT INTO listings (listingID, VIN, stockID, condition";
$SQL .= ", year, make, model, edition, engine, doors, bodyStyle, interiorType";
$SQL .= ", interiorColor, exteriorColor, features, driveType, fuelType, mileage";
$SQL .= ", price, comments, locationID, sale, status, images, addedBy, addedTime";
$SQL .= ") VALUES ('', '$this->vin', '$this->stockID', '$this->cond'";
$SQL .= ", '$this->year', '$this->make', '$this->model', '$this->edition', '$this->engine'";
$SQL .= ", '$this->doors', '$this->bstyle', '$this->itype', '$this->icolor', '$this->ecolor'";
$SQL .= ", '$this->features', '$this->trans', '$this->fuel', '$this->mileage', '$this->price'";
$SQL .= ", '$this->comments', '$this->locationID', '$this->sale', '$this->status', '$this->images'";
$SQL .= "', '2', NOW())";
Am I using a reserved word or something? I have been trying to get around this for a bit now, any help would be appreciated.
I get an error in the EXACT same spot on my update SQL as well.
$SQL = "UPDATE listings SET VIN='$this->vin', stockID='$this->stockID', condition='$this->cond'";
$SQL .= ", year='$this->year', make='$this->make', model='$this->model', edition='$this->edition', engine='$this->engine'";
$SQL .= ", doors='$this->doors', bodyStyle='$this->bstyle', interiorType='$this->itype', interiorColor='$this->icolor', exteriorColor='$this->ecolor'";
$SQL .= ", features='$this->features', driveType='$this->trans', fuelType='$this->fuel', maileage='$this->mileage', price='$this->price'";
$SQL .= ", comments='$this->comments', locationID='$this->locationID', sale='$this->sale', status='$this->status', images='$this->images'";
$SQL .= "' WHERE listingID='$this->listingID' LIMIT 1";
TIA.