This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

PDO ODBC Virtuoso No Work but No Error

By: a guest on Aug 5th, 2010  |  syntax: PHP  |  size: 0.51 KB  |  views: 46  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3. try { $dbc = new PDO('odbc:virtuoso','dba','dba'); }
  4. catch (PDOException $e)
  5.  {
  6.     logError('Failed to connect to database: ' . $e->getMessage());
  7.     exit(1);
  8.   }
  9.  
  10. try
  11. {
  12.   $dbc->exec("USE studies;");
  13.   $sql = "SELECT * FROM studies;";
  14.   $rs = $dbc->query($sql);
  15.   print_r($rs);
  16. }
  17. catch (PDOException $e)
  18. {
  19.   print "Failed SQL: " . $e->getMessage();
  20. }
  21.  
  22.   //foreach ($dbc->query($sql) as $row)
  23.   //{
  24.   //  print $row['id'] .' - '. $row['description'] . '<br />';
  25.   //}
  26.  
  27. print "Hey dude..\n";
clone this paste RAW Paste Data