MYSQLI: Null value in bind_param() ??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • yutlin

    MYSQLI: Null value in bind_param() ??

    Hello,

    Could anyone tell me if it is possible to bind a null value to a
    statement? I.E.
    $stmt->bind_param('is d',$var1,$var2, $var3);
    $var1 = (something indicating null);
    $var2 = (something indicating null);
    $var3 = (something indicating null);

    This would be useful as I have form fields that are not required and
    link to database fields that allow nulls. It would be nice to include
    all fields in the statement but assign a null value to fields for which
    the user did not fill in the corresponding form element.

    Thank you,
    Ryan

  • Wayne

    #2
    Re: MYSQLI: Null value in bind_param() ??

    On 6 Apr 2005 08:15:39 -0700, "yutlin" <yutlin@gmail.c om> wrote:
    [color=blue]
    >Hello,
    >
    >Could anyone tell me if it is possible to bind a null value to a
    >statement? I.E.
    >$stmt->bind_param('is d',$var1,$var2, $var3);
    >$var1 = (something indicating null);
    >$var2 = (something indicating null);
    >$var3 = (something indicating null);
    >
    >This would be useful as I have form fields that are not required and
    >link to database fields that allow nulls. It would be nice to include
    >all fields in the statement but assign a null value to fields for which
    >the user did not fill in the corresponding form element.[/color]

    Doesn't bind_param support the PHP null value?

    $var1= null;
    $var2= null;
    $var3= null;

    ???

    Comment

    Working...