Hello, please sign in or register
You are here: Home

ADOdb Database interface abstraction

Preface

Connecting to a Database? - ADOdb is all you'll ever need!

Installation

Download adodb463.zip (this is a platform independant latest release for PHP 4.1+,5)

Extract the files to an arbitary location which PHP can access(but not webserver...duh)

Getting started

This script illustrates how a connection is made

SetFetchMode(ADODB_FETCH_ASSOC);

	$c->debug = true; // set to true will print to screen the query and errors.

?>

Data extraction

GetAll("SELECT column(s) FROM table");

print_r($r);

// OUTPUTS: Array(row0 => Array('column0' => 'value'.... 'columnN'=>'value').. rowN => Array(...));   

$r = $c->GetRow("SELECT column(s) FROM table");

print_r($r);

// OUTPUTS: Array('column0' => 'value'.... 'columnN'=>'value');   

$r = $c->GetOne("SELECT column FROM table");

print_r($r);

// OUTPUTS: 'value' 

?>

Performance Monitoring

Create a table to store queries and their associated speed of execution

// SQL

CREATE TABLE adodb_logsql (

		  created datetime NOT NULL,

		  sql0 varchar(250) NOT NULL,

		  sql1 text NOT NULL,

		  params text NOT NULL,

		  tracer text NOT NULL,

		  timer decimal(16,6) NOT NULL

		)

Initiate the logging of SQL with $c->LogSQL();

External References

Comments

ninestab123
ninest123 One canada goose pas cher gucci outlet thing
Created 21/07/16
Title*
Comment

Prove you are not a robot

To prove you are not a robot, please type in the six character code you see in the picture below
Security confirmation codeI can't see this!
Contact
Name*
Email never shown*
Home Page

Author

Andrew Dodson
Since:Feb 2007

Comment | flag

Categories

Bookmark and Share