PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of thorr   DB MySQL Prepare Statements   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: DB MySQL Prepare Statements
Query MySQL using MySQLi prepared statements
Author: By
Last change: added a execute sql command
Date: 9 years ago
Size: 420 bytes
 

Contents

Class file image Download
<?php
DB
::Init('127.0.0.1','user','password','database'); //connect to the MySQL
DB::GetRow("select * from table where name=? and password=?",$name,$password); //accepts as many parameters as needed (one for every "?")
DB::GetAll("select * from table where field=? or field2=? or field3=?",$f1,$f2,$f2);
DB::Execute("delete from table where field=? or field2=? or field3=?",$f1,$f2,$f2);
print_r(DB::db_log());