Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. <?php
  2.  
  3. $db = 'C:UwAmpwwwkorek.accdb';
  4. $user = '';
  5. $password = '';
  6. if(!file_exists($db)){
  7. die('Error finding access database');
  8. }
  9. $connection = odbc_connect("Driver={Microsoft Access Driver (*.mdb,
  10. *.accdb)};Dbq=$db", $user, $password);
  11. if($connection){
  12. echo("yes connect");
  13. }
  14.  
  15. try{
  16. $sql = 'SELECT * FROM [ALL];';
  17. $result = odbc_exec($connection, $sql);
  18.  
  19. while(odbc_fetch_row($result)){
  20. $id = odbc_result($result,6);
  21. echo $id."<br>";
  22.  
  23. }
  24. }catch(PDOExepction $e){
  25. echo $e->getMessage();
  26. }
  27.  
  28. odbc_close($connection);
  29.  
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement