|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45154 /* or -- no longer used as comment chars
Submitted: 2008-06-03 05:56 UTC Modified: 2008-06-03 13:32 UTC
From: dillama at canada dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.2.6 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: dillama at canada dot com
New email:
PHP Version: OS:


 [2008-06-03 05:56 UTC] dillama at canada dot com
/* can no longer be used as a comment character to ignore all text after this character (seems to only affect 5.2)

-- never worked as a comment character in previous version of PHP

Reproduce code:
$dbh = @mysql_connect ("localhost", "aaa", "aaa") or die ("Cannot connect to DB");
mysql_select_db("test",$dbh) or die ("Cannot select DB");
$sql="select something from table /* dsfadsfasdfadfasdfasfdmkkn";

$result=mysql_query($sql,$dbh) or die ("Cannot submit query" . mysql_error());

Expected result:
As similar to PHP 5.1 series, the above statement should run without error. Note, -- should work but have never worked either.

Actual result:
SQL Error : 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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-03 13:32 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 15 01:01:27 2024 UTC