note 47966 rejected from function.mysqli-stmt-prepare by betz

From: Date: Tue, 07 Dec 2004 14:29:12 +0000
Subject: note 47966 rejected from function.mysqli-stmt-prepare by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-81489@lists.php.net to get a copy of this message
Note Submitter: programmer at bardware dot de ---- Hi, the procedural sample is wrong. mysqli_stmt_prepare(...) returns a boolean value. In the sample the statement returned from mysqli_stmt_init(...) is passed as first value and used as return value. As return value it's set to true what in further calls leads to the warning: Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, boolean given Sample must hence look like: $stmt = mysqli_stmt_init($conn); if (TRUE==mysqli_stmt_prepare($stmt, "SELECT District FROM City WHERE Name=?")) { Best, Bernhard

« previous php.notes (#81489) next »