Login   Register  
PHP Classes
elePHPant
Icontem

File: Example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Torben K.  >  Jade Dbo  >  Example.php  >  Download  
File: Example.php
Role: Example script
Content type: text/plain
Description: A simple example
Class: Jade Dbo
Database abstraction layer with drivers
Author: By
Last change:
Date: 2010-06-16 09:25
Size: 652 bytes
 

Contents

Class file image Download
<?php

include 'Dbo.php';

$cstring 'host=localhost;user=mysql;password=mysql123;database=mydb;persistent=true';

$sql Dbo::connect$cstring'MySql' );

echo 
'<pre>';
print_r$sql->query'select * from mytable' )->fetchAll() );
echo 
'</pre>';


function 
myfunction$arg ) {
     return 
Dbo::getHandle()->query'select '.$arg.' from mytable' )->fetch();
}

/* Multiple databases possible */

$cstring2 'host=127.0.0.2;user=mysql;password=mysql123;database=mydb;persistent=true';

Dbo::connect$cstring2'MySql''scon' );

print_rDbo::getHandle'scon' )->query'select * from myothertable' )->fetchAll() );

?>