File: Docs/Database.txt

Recommend this page to a friend!
  Classes of Minh Tien  >  Codeme PHP Framework  >  Docs/Database.txt  >  Download  
File: Docs/Database.txt
Role: Documentation
Content type: text/plain
Description: Documentation
Class: Codeme PHP Framework
MVC Web application development framework
Author: By
Last change:
Date: 6 years ago
Size: 1,283 bytes


Class file image Download
//Connect to database


//Connect to another db


//Make a query

$query=Database::query("select * from table_name");

//Work with anonymous function

$query=Database::query("select * from table_name",function($query){



//Get numrows


//Work with anonymous function


if((int)$result == 0)

{ //do something }


//Fetch assoc


//Work with anonymous function




//Get insert id


//Work with anonymous function


echo $result;


//Insert with ORM

$user = new DatabaseORM('users');

$user->username = 'test';

$user->password = md5('demodemo');


echo $id;

//Update with ORM

$user = new DatabaseORM('users');


$user->username = 'testtest'; $user->password = md5('fgfg');


//Delete with ORM

$user = new DatabaseORM('users');


For more information send a message to info at phpclasses dot org.