Re: INSERT question...
| From: | 1LT John W. Holmes | Date: | Wed, 20 Nov 2002 20:21:03 +0000 |
| Subject: | Re: INSERT question... | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-23532@lists.php.net to get a copy of this message | ||
> OK. This sounds great, but now I am getting a completely different
> error message.
>
> You have an error in your SQL syntax near '-sys) VALUES('sn4265-turner')'
at
> line 1
>
> Here is the INSERT statement:
>
> $query = "INSERT INTO accounts (id-sys)
> VALUES('".$accnts[0]."')";
>
> Do I have to rename the column? I would rather not if I can avoid
> it. If I must, is this a problem with PHP or MySQL not understanding '-'
in
> a column name? Thanks again.
Try putting backtics (not single quotes) around the column name.
$query = "INSERT INTO accounts (
id-sys) VALUES
('".$accnts[0]."')";
if that don't work, you'll have to rename the column.
---John Holmes...