php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #110 parser with "+" operator of string
Submitted: 1998-02-27 01:23 UTC Modified: 1998-02-27 01:45 UTC
From: dennys at iim dot nctu dot edu dot tw Assigned: rasmus (profile)
Status: Closed Package: Parser error
PHP Version: 3.0 Latest CVS OS: FreeBSD-2.2.5-SNAP
Private report: No CVE-ID: None
 [1998-02-27 01:23 UTC] dennys at iim dot nctu dot edu dot tw
the code is:
  $result = mysql("Graduate","SELECT DISTINCT gyear FROM graduate" +
                             " WHERE degree='$degree' ORDER BY gyear");

but got the error message:

Warning: MySQL query failed: parse error near '0' at line 1 in lib_simple.html on line 6

And if I change the code to one line. (don't use the "+" operator)

  $result = mysql("Graduate","SELECT DISTINCT gyear FROM graduate WHERE degree='$degree' ORDER BY gyear");

It's will run successfully.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-02-27 01:45 UTC] rasmus
There were big warnings when PHP 3.0b5 was released telling you that the
'+' operator was no longer overloaded.  It now only performs a
mathematical addition.  Use the '.' operator to concatenate strings.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 11:01:30 2024 UTC