#29905 [Opn->Bgs]: mysqli prepare() does not work

From: Date: Tue, 31 Aug 2004 05:44:47 +0000
Subject: #29905 [Opn->Bgs]: mysqli prepare() does not work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-65492@lists.php.net to get a copy of this message
ID: 29905 Updated by: georg@php.net Reported By: lucas at maurobenevides dot com dot br -Status: Open +Status: Bogus Bug Type: MySQL related Operating System: Windows 2000 PHP Version: 5.0.1 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php ext/mysqli doesn't work with MySQL 4.0.x. You need MySQL >= 4.1.3. Previous Comments: ------------------------------------------------------------------------ [2004-08-31 06:36:48] lucas at maurobenevides dot com dot br Description: ------------ I could not use Prepared Statement in my program. Any query I use within $mysqli->prepare() returns a null variable. When I print the $mysqli->error it prints out "Unknown command" I am pretty sure it is not the query string, because the same Query I use with the query() (without prepare) statement and it works fine. I haven't changed my php.ini, except by uncommenting the line extension=php_mysql.dll and adding the line: extension=php_mysqli.dll Please, Test it in the Windows 2000 I use Mysql 4.0.2 Reproduce code: --------------- $conn = new mysqli(HOST_MYSQL, USER_MYSQL, PASSWD_MYSQL, DBNAME_MYSQL); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $consulta = $conn->prepare("SELECT MD5_PASSWORD FROM tb_user WHERE TXT_LOGIN=?" ); if (!$consulta) printf($conn->error); $consulta->bind_param("s", $_POST["password"]); $result = $consulta->fetch(); Expected result: ---------------- Unknown command Fatal error: Call to a member function fetch() on a non-object in C:mydir on line 17 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29905&edit=1

« previous php.bugs (#65492) next »