ID: 29530 User updated by: chenxi at shine dot com dot cn Reported By: chenxi at shine dot com dot cn Status: Open Bug Type: MySQL related Operating System: Redhat Linux 9 PHP Version: 5.0.0 New Comment:
i make a mistake: $stmt = $mysqli->prepare("SELECT id, name FROM program") Previous Comments: ------------------------------------------------------------------------ [2004-08-05 11:50:07] chenxi at shine dot com dot cn Description: ------------ give me following error message: Warning: mysqli_prepare() [function.mysqli-prepare]: Error (00000/1047): Unknown command in /shine/htdocs/test.php on line 16 Reproduce code: --------------- $mysqli = new mysqli("localhost", "root", "root", "hotel"); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } if ($stmt = $mysqli->prepare($link, "SELECT id, name FROM program")) { $stmt->execute(); $stmt->bind_result($col1, $col2); while ($stmt->fetch()) { printf("%i %s\n", $col1, $col2); } $stmt->close(); } else { print "stmt failed<br/>"; } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29530&edit=1