|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-01-07 10:31 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 04:00:02 2025 UTC |
Description: ------------ a prepared statement used in a class. $this->mysql == mysql connection $database == name of the database Reproduce code: --------------- example #1 (work): $stmt = $this->mysql->prepare("SHOW TABLES FROM ".$database); $stmt->execute(); example #2 (don't work): $stmt = $this->mysql->prepare("SHOW TABLES FROM ?"); $stmt->execute(array($database)); Expected result: ---------------- both examples should work! Actual result: -------------- error: 42000 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''databasename'' at line 1