SHARE
TWEET

PDO ODBC Virtuoso No Work but No Error

a guest Aug 5th, 2010 49 Never
  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";
RAW Paste Data
Top