PHP Classes

File: select_sample.php

Recommend this page to a friend!
  Classes of Ihab Abu Afia   basic_db   select_sample.php   Download  
File: select_sample.php
Role: Example script
Content type: text/plain
Description: Select Example
Class: basic_db
Manipulate MySQL table records programmatically
Author: By
Last change:
Date: 17 years ago
Size: 650 bytes
 

 

Contents

Class file image Download
<?

include('basic_db.php');

   
$db = new Database;
   
$db->Table_Name('accounts');
   
$db->Fields(array('username')); // This is optional if you don't add it, it will take the default which is '*'.
   
$db->Where('user_id','4'); // This is optional when you need it.
   
$db->OrderBy('username','DESC'); // This is optional when you need it, you can also use it as $db->OrderBy('account_name'); and the default will be ASC;
   
$db->doPrint(); // This is for debugging purposes to echo the query, so it's optional.
   
$db->doPrint_r(); // This is for debugging purposes to echo the result of the query, so it's optional.
   
$result = $db->Select();

?>