|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-08-31 07:44 UTC] georg@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 11:00:01 2025 UTC |
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