|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56308 Semicolon detector needs to trim
Submitted: 2005-02-18 21:31 UTC Modified: 2005-02-19 16:54 UTC
From: sean at caedmon dot net Assigned:
Status: Not a bug Package: PDO_MYSQL (PECL)
PHP Version: 5.0.3 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: sean at caedmon dot net
New email:
PHP Version: OS:


 [2005-02-18 21:31 UTC] sean at caedmon dot net
or at least that's my guess.

when calling $PDObj->exec()
"sql statement here;" works as expected
"sql statement here; " causes a MySQL syntax error
(note the trailing space)

Reproduce code:
$sql = "SELECT * FROM some_table; ";
if (FALSE === $res = $PDO->exec($sql)) {
  $err = $PDO->errorInfo();
  echo "Error: {$err[1]}: {$err[2]}\n";

Expected result:
no error

Actual result:
Error: 1064: You have an error in your SQL syntax near '; ' at line 1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-19 16:54 UTC]
Don't do that ;-)
The query is passed on to mysql, and it doesn't like what you said.
Not a PDO problem.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Dec 05 16:01:29 2023 UTC