Wednesday, June 5, 2013

what supported PDO driver in php

  • PDO_DBLIB ( FreeTDS / Microsoft SQL Server / Sybase )
  • PDO_FIREBIRD ( Firebird/Interbase 6 )
  • PDO_IBM ( IBM DB2 )
  • PDO_INFORMIX ( IBM Informix Dynamic Server )
  • PDO_MYSQL ( MySQL 3.x/4.x/5.x )
  • PDO_OCI ( Oracle Call Interface )
  • PDO_ODBC ( ODBC v3 (IBM DB2, unixODBC and win32 ODBC) )
  • PDO_PGSQL ( PostgreSQL )
  • PDO_SQLITE ( SQLite 3 and SQLite 2 )
  • PDO_4D ( 4D )
example use
try {   
 # MS SQL Server and Sybase with PDO_DBLIB   
  $DBH = new PDO("mssql:host=$host;dbname=$dbname, $user, $pass");   $DBH = new PDO("sybase:host=$host;dbname=$dbname, $user, $pass"); # MySQL with PDO_MYSQL   
 $DBH = new PDO("mysql:host=$host;dbname=$dbname"$user$pass);    
# SQLite Database 
   $DBH = new PDO("sqlite:my/database/path/database.db"); 
 catch(PDOException $e) {   
   echo $e->getMessage();   


no conflict query good example and solve jquery verion compactibilty

<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>
<div id="log">
<h3>Before $.noConflict(true)</h3>
</div>
<script src="http://code.jquery.com/jquery-1.6.2.js"></script>
<script>
var $log = $( "#log" );
$log.append( "2nd loaded jQuery version ($): " + $.fn.jquery + "<br>" );
/*
Restore globally scoped jQuery variables to the first version loaded
(the newer version)
*/
jq162 = jQuery.noConflict(true);
$log.append( "<h3>After $.noConflict(true)</h3>" );
$log.append( "1st loaded jQuery version ($): " + $.fn.jquery + "<br>" );
$log.append( "2nd loaded jQuery version (jq162): " + jq162.fn.jquery + "<br>" );
</script>
</body>
</html>