php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58755 select * fails when select column name returns a result.
Submitted: 2009-07-07 00:41 UTC Modified: 2009-08-03 02:26 UTC
From: sucheta_g at yahoo dot com Assigned:
Status: Closed Package: PDO_MYSQL (PECL)
PHP Version: 5.2.8 OS: Windows XP
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.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sucheta_g at yahoo dot com
New email:
PHP Version: OS:

 

 [2009-07-07 00:41 UTC] sucheta_g at yahoo dot com
Description:
------------
I am running MySQL client version: 5.1.30 which has been bundled with Xampp version 1.7. 
This is the web server etc details under Xampp installation
    * Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i mod_autoindex_color
PHP/5.2.8
    * MySQL client version: 5.1.30
    * PHP extension: mysql


The tables are of type InnoDB. 

I have  a query "select * from tablename"   which runs fine under phpmyadmin . It fails in
my php code. The error says "Apache needs to close, send error report". 
In reality Apache doesn't close .
Also the same query "select Username from tablename" goes through as expected. Here Username is a column name. The problem arises only when I use PDO not otherwise. 





Reproduce code:
---------------
$dbLink = $database->connectToDb();
if($dbLink instanceof PDO)
			{
 strStatement="SELECT * FROM user_login WHERE `Password` ='$encryptOldPwd'";
		   $result=$dbLink->query($strStatement)->fetch() ;
 echo ($result[0]->UserName);
		   }

Expected result:
----------------
 I expect to see the Username on the browser.

Actual result:
--------------
 The browser shows a dialog box  with error says "Apache needs to close, send error report". 
In reality Apache doesn't close .

When I click Do not send error , dialog box goes away and browser is blank.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-03 02:23 UTC] sucheta_g at yahoo dot com
Hello everybody,


The solution is simple:

- Download:
http://windows.php.net/downloads/snaps/php-5.2-win32-VC6-x86-latest.zip
- Unzip & copy libmysql.dll into xampp\apache\bin & xampp\php.
- Restart apache.
 [2009-08-03 02:26 UTC] sucheta_g at yahoo dot com
Hello everybody,

Similar to #46289  	PDO execute causes apache.exe to crash. Please look up this bug report for further details.
Check out:
Magento-forum:
http://www.magentocommerce.com/boards/viewthread/31789/

Thanks
Sucheta
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 23:01:30 2024 UTC