#30883 [Bgs->Opn]: MySQL query bug
| From: | shhbrk at diku dot dk | Date: | Thu, 25 Nov 2004 15:06:03 +0000 |
| Subject: | #30883 [Bgs->Opn]: MySQL query bug | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-69442@lists.php.net to get a copy of this message | ||
ID: 30883
User updated by: shhbrk at diku dot dk
Reported By: shhbrk at diku dot dk
-Status: Bogus
+Status: Open
Bug Type: MySQL related
Operating System: WIN98
PHP Version: Irrelevant
New Comment:
I'm sorry but the documentation (9.3 User Variables) isn't helping me -
it doesn't explain why the query works from the MySQL-prompt and not
through PHP...
Previous Comments:
------------------------------------------------------------------------
[2004-11-25 11:36:13] radical@php.net
This is not a PHP bug.
Please read MySQL Documentation at
http://dev.mysql.com/doc/mysql/en/index.html
... in special
documentation related to user variables.
------------------------------------------------------------------------
[2004-11-24 17:09:24] shhbrk at diku dot dk
Description:
------------
Hello all
I'm expiriencing a bug when trying to perform something like this MySQL
query from PHP:
Select *, @d := x^2
from o
where cos(@d)+sin(@d)>0;
this is a short version of my real query, but shows the deal. (x is a
key in o and the important part is the repeated use of @d, this is what
I want since it is a more complex calculation in "real life".)
When I test it from the prompt in MySQL it works just fine and gives
the results as expected.
But from a PHP script it returns 0 rows...!
I'm certain that something is wrong because when I use a version that
looks like this: WHERE cos(x^2)+sin(x^2)>0
- that is @d substituted in place - it work just fine.
Can anyone explain this ?
Thanks in advance.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30883&edit=1