php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12394 Select statement
Submitted: 2001-07-26 07:42 UTC Modified: 2001-07-27 23:34 UTC
From: peter-h dot hoffmann at dil dot de Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 4.0.6 OS: Windows NT4.0
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: peter-h dot hoffmann at dil dot de
New email:
PHP Version: OS:

 

 [2001-07-26 07:42 UTC] peter-h dot hoffmann at dil dot de
I don't know if it is really a bug, but something is going on.
If I make a mysql select statement: 
mysql> select * from table_name where row_name like "%searchstring%"; 
then it shows the correct result!

the same within php:
$sql="select * from table_name where row_name like \"%searchstring%\";
$result=mysql_query($sql);
then it shows an incorrect result!

Another hint for you:
I use the Xitami Webserver Version 2.5b4, it doesn't work with the <FORM ACTION="program.php" METHOD="POST">.
I change to Version 2.5b5 now it works great!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-27 08:45 UTC] peter-h dot hoffmann at dil dot de
Excuse me, but this was a bloody amateur failure !!!

The result is an object, so what to do is:

for ($count = 1; $row = mysql_fetch_object($result); ++$count){ echo $row->col_name_1; echo $row->col_name_2 ... }

:-)))
 [2001-07-27 23:34 UTC] sniper@php.net
user error
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Feb 05 02:05:48 2023 UTC