Re: Problems using PDO_MYSQL with MySQL3
| From: | Richard Thomas | Date: | Fri, 24 Mar 2006 12:30:56 +0000 |
| Subject: | Re: Problems using PDO_MYSQL with MySQL3 | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-3650@lists.php.net to get a copy of this message | ||
Im pretty sure the SQL libraries changes a bit between 3.x and 4.x and are not compatible.
You would need to compile 2 seperate versions of php.. One for 3 using the 3.x client libraries and one for 4/5 using the 4 or 5 client libraries.
Richard Thomas - CEO
Cyberlot Technologies Group Inc.
507.398.4124 - Voice
Andreas Korthaus wrote:
Hi! I'm using PDO on server running PHP 5.1.2, MySQL 4.1.14, MySQL 3.23.58 and MySQL 5.0.18. The PDO version, bundled with PHP 5.1.2 is used. PDO_MYSQL as well as the old mysql extension both use MySQL client library version 5.0.18. I have created a very simple script, which should read data from a table in the MySQL3 database: $sql = 'SELECT * FROM test'; try { $dbh = new PDO('mysql:host=localhost;dbname=test', 'user', 'pass'); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $result = $dbh->query($sql); var_dump($result); $row = $result->fetch(); var_dump($row); } catch(PDOException $e){die($e->getMessage());} But this does not work. Connect seems to work, but PDO::query() returns false - I have no idea why. No exception, no SQL error... I have ported this to mysql_* functions, and this works: $sql = 'SELECT * FROM test'; $conn = mysql_connect('localhost', 'user', 'pass'); mysql_select_db("test"); $result = mysql_query($sql); $row = mysql_fetch_assoc($result); var_dump($row); shows a row with data now. If I dump the sql-structure/data from MySQL3 and import it into MySQL4.1 and simply change the PDO script to use the MySQL4.1 hostname, it works like a charme. Any ideas? What's going wrong here? best regads Andreas