Hi KM--

The general format for the INSERT goes something like this:

INSERT INTO anytable (columnname) VALUES (NULL);

You technically do not need the newlines ("\n") in your $stmt.

So I guess I'm saying that in the code if you change the $asinteger
assignment to:

$asinteger = "NULL"; /* notice the quotes */

it may work.  This would make the $asinteger PHP variable a string, but
since the SQL would either like to have a numeric value there or the
keyword NULL, that is probably what you want.

Good luck,

At 07:23 PM 7/6/01 +0200, Kiss Marton wrote:
>I like to insert null values with placeholders in ibase_query. But it
>doesn't work.
>$stmt = "insert into category_prop \n".
>    "(id, category_id, category_prop_type_id, asinteger, asfloat,
>ascurrency, asstring) \n".
>    "values (gen_id(gen_category_prop_id,1),1097,109,?,?,?,?)";
>$asinteger = null;
>$asfloat = 2.5;
>$ascurrency = 3;
>$asstring = "apple";
>$sth = ibase_query($dbh, $stmt,
>    $asinteger,
>    $asfloat,
>    $ascurrency,
>    $asstring);
>This statement insert '0' instead null. Why?
>Best Regards,
>Kiss Marton

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to