hovercraft
Technical User
I can connect to a local mdb via PDO. I can access data contained in the local table in the local mdb. What I can't seem to do is to access data contained in a linked table in the same mdb. The linked table actually resides on another server but I am able to link to it via a network drive or fully qualified name.
Any help would help a heap!
The comments are the parts I've been using to toggle back and forth between the local table and the linked table. I do not recieve an error with the linked table, just no data and the code seems to stop without echoing "this is after the odbc happens"
Any help would help a heap!
PHP:
<?php
echo "This is before the odbc happens <br />";
try{
$dbName = "D:\\Websites\\thisismysite.net\\test.mdb";
$db = new PDO("odbc:DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$dbName; Uid='Admin'; Pwd='';");
$sql = "SELECT * FROM Tickets1";
$sql .= " WHERE TicketLastName = 'SMITH'";
// $sql = "SELECT * FROM tbl_names";
// $sql .= " WHERE lastname = 'SMITH'";
$result = $db->query($sql);
echo "test - before while";
while ($row = $result->fetch())
{
echo "test - in while";
$LastName = $row["TicketLastName"];
//$LastName = $row["lastname"];
echo "hello ";
echo $LastName; }
}
catch (PDOException $e)
{
print "ERROR: " . $e->getMessage(). "<br/>";
//die();
}
echo "<br />This is after the odbc happens";
?>
The comments are the parts I've been using to toggle back and forth between the local table and the linked table. I do not recieve an error with the linked table, just no data and the code seems to stop without echoing "this is after the odbc happens"