Re: SQL Error
| From: | Steve Fitzgerald | Date: | Thu, 02 Aug 2001 13:43:01 +0000 |
| Subject: | Re: SQL Error | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-10995@lists.php.net to get a copy of this message | ||
"Steve Fitzgerald" <sf@mnetsys.com> wrote in message
news:20010802133414.96504.qmail@pb1.pair.com...
> I keep getting the following SQL error:
>
The last fieldname is CompanyID not ContactID.
You have an error in your SQL syntax near ')' at line 14
>
> Line 14 is: '$FirstName', so the error must correspond to a different part
> of the code.
>
> Any ideas?
>
> $add_contact_sql = "INSERT INTO $table_name
> (ContactID, FirstName, LastName, Title, WorkPhone,
> HomePhone,Mobile,EmailName,Birthday,CompanyID)
> VALUES
> ('',
> '$FirstName',
> '$LastName',
> '$Title',
> '$WorkPhone',
> '$HomePhone',
> '$Mobile',
> '$EmailName',
> '$Birthday',
> '$CompanyID', //this is actually CompanyID not ContactD
> )";
>
> $result = @mysql_query($add_contact_sql, $connection) or die
> (mysql_error());
> ?>
>
>