Menu

#353 Cannot run cubrid_bind with NULL value

open
nobody
None
5
2012-12-18
2012-12-18
Jira Trac
No

Create the following test table in demodb database:
{code}
CREATE TABLE Teste(Coloana NUMERIC(18,2));
{code}

Here is the test.php code:
{code}
?php
$conn = cubrid_connect(localhost, 33000, demodb, dba, );
if ($conn) {
$sql = INSERT INTO Teste(Coloana) VALUES(?);
$req = cubrid_prepare($conn, $sql);

cubrid_bind($req, 1, null, null);
cubrid_execute($req);
}
?

Here it says for NULL to put NULL:
http://php.net/manual/en/function.cubrid-bind.php
{code}

The error obtained is:
{code}
Warning: cubrid_bind(): Bind value type unknown : null
in C:\Users\user\Desktop\Bug\test.php on line 7
{code}

Same issue happens with either value null,NULL or NULL. It works only if you put cubrid_bind($req, 1, null, string) or cubrid_bind($req, 1, null, numeric). If this is the correct behaviour the documentation needs to be fixed as from it users understand to put NULL or NULL.

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.