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

 ID:               51596
 Updated by:       fel...@php.net
 Reported by:      foo-script at o2 dot pl
 Summary:          Exception when creating database with PDO
-Status:           Assigned
+Status:           Feedback
 Type:             Bug
 Package:          PDO related
 Operating System: Windows XP SP3
 PHP Version:      5.3.2
 Assigned To:      mysql

 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

I can't reproduce it.


Previous Comments:
------------------------------------------------------------------------
[2010-04-19 02:40:18] foo-script at o2 dot pl

Description:
------------
A "test script" produced following exception:



exception 'PDOException' with message 'SQLSTATE[HY000]: General error'
in L:\Program Files\Apache Software
Foundation\Apache2.2\htdocs\readme.php:44 Stack trace: #0 L:\Program
Files\Apache Software Foundation\Apache2.2\htdocs\readme.php(44):
unknown() #1 {main}



However, database have been successfuly created.

Test script:
---------------
try{

        $pdo=new PDO('mysql:host='.$dbHost.';'.'dbname=mysql;'.'port='.$port,
'root', $dbKey, array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES
\'UTF8\''));



        $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

        $result=$pdo->query('CREATE DATABASE test;'); }

Expected result:
----------------
In my opinion exception should not be thrown, cause effect is good.



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



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

Reply via email to