|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-07-23 23:25 UTC] chealer at gmail dot com
[2015-07-29 00:17 UTC] cmb@php.net
[2015-07-29 00:18 UTC] cmb@php.net
-Status: Open
+Status: Closed
-Package: Documentation problem
+Package: PDO related
-Operating System:
+Operating System: *
-Assigned To:
+Assigned To: cmb
[2015-07-29 00:18 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 19:00:01 2025 UTC |
Description: ------------ statement This must be a valid SQL statement for the target database server. --- From manual page: http://www.php.net/pdo.prepare --- In fact, as the text above explains, if parameters are used, the first argument must contain a string similar to a SQL statement, but which is not a valid SQL statement (for example, "SELECT name, colour, calories FROM fruit WHERE calories < ? AND colour = ?"). There is a terminological challenge here - perhaps "statement template" would appropriately describe what the argument actually contains. The text above is less misleading, but is also incorrect: The SQL statement can contain zero or more named (:name) or question mark (?) parameter markers for which real values will be substituted when the statement is executed. You cannot use both named and question mark parameter markers within the same SQL statement; pick one or the other parameter style. By the way, this does not specify what named parameter markers are, and the manual apparently never does that. Quite clearly, these start with a colon, but there is no specification of what constitutes a name. Visibly, names cannot contain a dot, although the error message leaves me wondering whether that is a bug ("PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 0 [Sybase][ODBC Driver][SQL Anywhere]L'expression près de ':?.nomdossier' est incorrecte", while the parameter marker I tried using is ":dossr.nomdossier").