Back to index

php5  5.3.10
db.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /* assumes that you have the freetds db.lib on windows */
00004 
00005 dl('php_pdo.dll');
00006 dl('php_pdo_sybase.dll');
00007 
00008 try {
00009 
00010 $db = new PDO('sybase:', 'pdo', 'pdo');
00011 $db->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_EXCEPTION);
00012 debug_zval_dump($db);
00013 
00014 $stmt = $db->prepare('select 10');
00015 debug_zval_dump($stmt);
00016 
00017 $x = $stmt->execute();
00018 debug_zval_dump($x);
00019 
00020 while (($r = $stmt->fetch())) {
00021        print_r($r);
00022 }
00023 
00024 } catch (Exception $e) {
00025        print $e;
00026 }
00027 
00028 $stmt = null;
00029 $db = null;
00030 echo "All done\n";
00031 ?>