Re: Inserting NULL via OBDC
| From: | Ignacio Vazquez-Abrams | Date: | Sun, 10 Dec 2000 19:55:48 +0000 |
| Subject: | Re: Inserting NULL via OBDC | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-29579@lists.php.net to get a copy of this message | ||
On Sun, 10 Dec 2000, Denis Voitenko wrote:
> I am trying to insert a NULL value via OBDC (Access 2000) like this:
>
> $result=odbc_exec($connect, "insert into names values(NULL, '$name')");
>
> but receive the following error:
>
> Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] You tried to
> assign the Null value to a variable that is not a Variant data type., SQL
> state 23000 in SQLExecDirect in C:\wwwhome\gb.php on line 11
>
> obviously, it has a problem inserting it into a column that has a type
> AutoNumber. What is the right way of doing it it?
>
Try:
"INSERT INTO names (Field2) VALUES ('$name')"
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>