Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. $query = 'SELECT * FROM Product';
  2. $mdb_file = '/var/www/html/azam/Product.mdb';
  3. $driver = 'MDBTools';
  4. $dataSourceName = "odbc:Driver=$driver;DBQ=$mdb_file;";
  5. $connection = new PDO($dataSourceName);
  6. $result = $connection->query($query)->fetchAll(PDO::FETCH_ASSOC);
  7. print '<pre>';
  8. print_r($result);
  9. print '</pre>'
  10.  
  11. $query = 'SELECT * FROM Product';
  12. $mdb_file = '/var/www/html/azam/Product.mdb';
  13. $connection = odbc_connect("Product.mdb","","");
  14. $result = odbc_exec($connection,$query);
  15. while($row = odbc_fetch_array($result))
  16. { echo "<pre>";
  17. print_r($row);
  18. echo "</pre>";
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement