ID:               31175
 Updated by:       [EMAIL PROTECTED]
 Reported By:      vortexx at freemail dot hu
-Status:           Open
+Status:           Feedback
 Bug Type:         MySQL related
 Operating System: Windows 2000 Server, SP4
 PHP Version:      5.0.3
 New Comment:

Can't reproduce.
Check your code and provide more info if you're still experiencing this
problem.


Previous Comments:
------------------------------------------------------------------------

[2004-12-18 05:53:25] vortexx at freemail dot hu

Description:
------------
When a query containing CONCAT(...) with a string plus a reference to a
certain database field is run via PHP, no results and nop errors are
returned. The exact same query run via MySQL commandline returns
results as expected.

With 5.0.2 the exact same script (with ALL PHP configs the same, even
the same PHP.INI) returns results as expected. Thus I believe this is
not MySQL related but rather related to PHP5.0.3 and the php_mysql.dll
included with it?!

I also tried the latest PHP snapshot, but the same thing happens. 

Not sure what other info might be relevant and needed, I would be glad
to provide whatever info you may find necessary.

Reproduce code:
---------------
<%
/// Omitting the mysql_connect part of the code...!

/// This returns no results under PHP5.0.3,
/// while under PHP5.0.2 it returns results as expected.
$query = "SELECT CONCAT(tel,'blabla') as tel from hotels where
id='$id'";
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);
print_r($row);

/// This, however, works!
/// Difference is that two ***fields*** are CONCAT-ed.
$query = "SELECT CONCAT(tel,name) as tel from hotels where id='$id'";
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);
print_r($row);

/// This also works!
/// This time two ***strings*** are CONCAT-ed.
$query = "SELECT CONCAT('just test','blabla') as tel from hotels where
id='$id'";
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);
print_r($row);
%>

Expected result:
----------------
I should get the telephone number of the hotel joined with the string
"blablabla".

Actual result:
--------------
Get no results from the MySQL query, but no errors either (MySQL or
PHP).


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=31175&edit=1

Reply via email to