Edit report at https://bugs.php.net/bug.php?id=52637&edit=1
ID: 52637 Updated by: ssuffic...@php.net Reported by: angelo dot courtel at laposte dot net Summary: bug in prepare statement -Status: Open +Status: Feedback Type: Bug Package: PDO related Operating System: Debian Lenny PHP Version: 5.2.6-1+lenny6 Block user comment: N Private report: N New Comment: Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. Some drivers implement their own parameter binding. Which database driver does this pertain to? MySQL, PostrgreSQL, Oracle, DBLIB?? Previous Comments: ------------------------------------------------------------------------ [2010-10-12 12:09:23] ddebernardy at yahoo dot com I ran into this one too a long time ago, and it was due to the presence of multiple occurrences of named parameters in the query. If you change the two occurrences of :month to :month and :month2, then bind the parameters accordingly, the bug will go away. The workaround is not optimal, but it works. ------------------------------------------------------------------------ [2010-09-10 14:38:09] angelo dot courtel at laposte dot net I ve commented only first line of my sql statement, not entire statement. ------------------------------------------------------------------------ [2010-09-10 13:40:41] u...@php.net Your "//works fine" code sample should do exactly nothing because there is no SQL statement run. The SQL statement is commented out. No "predifining" of any kind should happen. ------------------------------------------------------------------------ [2010-09-07 21:44:13] angelo dot courtel at laposte dot net Well, but I want find a way to use a prepared statement, without need to predeclare all paramètres on a sql comment ! It s not a very optimized solution. ------------------------------------------------------------------------ [2010-09-06 15:13:59] u...@php.net Well, if you comment out your SQL statement, it should work fine regardless what it may look like... "-- " starts a single line SQL comment. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=52637 -- Edit this bug report at https://bugs.php.net/bug.php?id=52637&edit=1