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 Nicholas Oliveira  >  Cyber MySQL  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: a example how to use
Class: Cyber MySQL
Execute MySQL queries using lists of arguments
Author: By
Last change: examples of new class updated
Date: 2010-04-27 10:03
Size: 912 bytes
 

Contents

Class file image Download
<?

$example 
= new SQLConnect();

//Variables

 
$example->getRows(); //return quantity of rows
 
$example->$result// return result of mysql query (return int)




// basic query

$ex $example->Query("SELECT field1, field2, field3 FROM table"); 

?>

<? do{ ?>
    
 echo $ex['field1'];

<? }while($exe mysql_fetch_assoc($example->result)); ?>





<? //basic insert

    
$fields = array('field1''field2''field3');
$content = array("name" "surname""age");


if(
$example->SQLInsert("table"$fields$content){
        
echo 
"Sucess";
}else{
    
 echo 
"Error on insert";

}

 
?>


<? // UPDATE 

if($example->SQLUpdate("table""field1""name""field2""surname")){

echo 
"sucess";

}else{

echo 
"error:"

}


?>




<?  //DELETE

 
if($example->SQLDelete("table" "field1" "name")){
    
  echo 
"sucess";
}else{
 
  echo 
"error";    
  
}

?>