Hi all,
I can use PDO to connect local mysql database successfully , but when i try to use ODBC (driver 5.1) to connect remote database , i have an error code Failed: could not find driver
my php code as below , please advise , thank you
[php]<?php
try
{
$dsn = “odbc:DRIVER={MySQL ODBC 5.1 Driver};host=192.168.79.10;dbname=aaa”;
$dbh = new PDO($dsn, “testuser”, “88888888”);
$dbh->setAttribute(PDO::ATTR_EMULATE_PREPARES, TRUE);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// All other database calls go here
}
catch (PDOException $e)
{
echo "Failed: ". $e->getMessage();
}
$sql = “select * from account’
order by callednum”;
// Execute the statement and echo the results
$results = $dbh->query($sql);
foreach ($results as $row)
{
echo "
$row[account] | $row[callednum] | $row[finalDestination] | $row[countryId] | $row[country] |
}
?>[/php]
Brgds/Brandon Chau