I am working with the [man]MySQLi[/man] Database Class.
I thought I would have a look at [man]MySQLi_STMT[/man] possibilities.
You do:
$stmt = mysqli->prepare(SQL)
$stmt->bind_param( type, $var )
$stmt->execute()
$stmt->bind_result( $vars .... )
$stmt->fetch()
echo $vars ....
My questioning regards what type I should set for $var with a NULL value?
http://www.php.net/manual/en/mysqli-stmt.bind-param.php
There are 4 types:
i corresponding variable has type integer
d corresponding variable has type double
s corresponding variable has type string
b corresponding variable is a blob and will be sent in packets
My tests show that both 's' and 'i' works without Warning.
And so I guess that NULL has no special type.
Or maybe can be used in ALL 4 types.
And in any sort of field in database.
And in mysqli::bind_param method corresponding to any 'type'.
Is this correct?