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
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dennys at iim dot nctu dot edu dot tw
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Tue Apr 16 22:01:27 2024 UTC