Jul
29
2009

Adodb PHP simple access to MySql – Oracle – Interbase

PHP’s database access functions are not standardised. This creates a need for a database
class library to hide the differences between the different databases (encapsulate the
differences) so we can easily switch databases.

Requires PHP4. Based on the best ideas of PEAR, phpdb and Microsoft’s ADO.

MySQL Usage:

include(‘adodb.inc.php’);
ADOLoadCode(‘mysql’);
$conn = &ADONewConnection();
$conn->PConnect(‘localhost’,'userid’,'password’,'database’);
$rs = $conn->Execute(’select * from table’);
rs2html($rs); /* recordset to html table */

Oracle Usage:

include(‘adodb.inc.php’);
ADOLoadCode(‘oracle’);
$conn = &ADONewConnection();
$conn->PConnect(”,’scott’,'tiger’);
$rs = $conn->Execute(’select * from table’);
rs2html($rs); /* recordset to html table */

Interbase Usage:

include(‘adodb.inc.php’);
ADOLoadCode(‘ibase’);
$conn = &ADONewConnection();
$conn->PConnect(‘c:\ibase\employee.gdb’,’sysdba’,'masterkey’);
$rs = $conn->Execute(’select * from table’);
rs2html($rs); /* recordset to html table */

http://php.weblogs.com/adodb

Related posts:

  1. Conflicto puerto 8080 Oracle XE 10 (problem with port 8080) – Oracle 10g Listener port 8080 conflict
  2. Mini tutorial comandos Mysql
  3. Conexión a mysql desde PHP, buscar
  4. Timestamp en php y mysql
  5. Función para Importar archivo (parser) a (from) CSV a variable PHP

Written by doutdex in: Uncategorized | Tags: ,

No Comments »

RSS feed for comments on this post. TrackBack URL


Leave a Reply

TheBuckmaker.com Wordpress Themes | Geld von Privat, Streaming Audio