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 Peter  >  Simple MySQL Tool  >  Example.php  >  Download  
File: Example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Simple MySQL Tool
Execute common MySQL database queries
Author: By
Last change:
Date: 2014-01-14 20:16
Size: 946 bytes
 

Contents

Class file image Download
<?php 
//Create
$mysql['192.168.1.10'] = new MySQL('localhost''root''0000''mysql');
$mysql['192.168.1.10']->table('test');
$mysql['192.168.1.10']->1;
$mysql['192.168.1.10']->'peter';
$mysql['192.168.1.10']->2;
$mysql['192.168.1.10']->'joe';
$mysql['192.168.1.10']->insert();

//Read
$mysql['192.168.1.10']->table('test');
$mysql['192.168.1.10']->'peter';
$mysql['192.168.1.10']->'joe';
$mysql['192.168.1.10']->find();

//Update
$mysql['192.168.1.10']->table('test');
$mysql['192.168.1.10']->2;
$mysql['192.168.1.10']->'brian';
$mysql['192.168.1.10']->modify(array('a' => 1'b' => 'peter'));

//Delete
$mysql['192.168.1.10']->table('test');
$mysql['192.168.1.10']->1;
$mysql['192.168.1.10']->'peter';
$mysql['192.168.1.10']->delete();

//Use SQL
$mysql['192.168.1.10']->bind_param('INSERT INTO test (a, b, c, d) VALUES (?, ?, ?, ?)', array(1'peter'2'joe'));
$mysql['192.168.1.10']->query();
?>