Database

Contoh yang menunjukkan bagaimana kelas database digunakan. Untuk perincian lengkap, silakan baca setiap halaman yang menjelaskan setiap fungsi.


Standard Query With Multiple Results (Object Version)

TNG::SUM("artikel",$ECT="SUM(row)",array("user_id" => "1"));

Standard Query With Single Result
 
 $data   = new TNG();
 $count  =  $data->select_where(" * ", " gallery ");
 while ($row = $data->getObjectResults()){
 echo $row->nama_file; 
}

Standard Query WHERE Clause

 $data   = new TNG();
 $count  =  $data->select_where(" * ", " gallery ", " `num` = '1' ");
 while ($row = $data->getObjectResults()){
 echo $row->nama_file; 
}

Standard array

$data   = new TNG();
$count  =  $data->select_array(" * ", " gallery ", " `id` = '1' ");
$En     = $data->getObjectResults();
echo $En->nama_file; 

Standard select Group

$data   = new TNG();
$count  =  $data->select_Group(" * ", " gallery ", " num= '1'","ORDER BY id DESC");
$PACK   = $data->getObjectResults();{
  echo $PACK->nama_file; 
}


Standard Insert

$data = new TNG();     
$arr = array();                   
$arr["user"] = $_POST['a4'];     
$arr["pass"] = "net";
$count=$data->insert(" gallery ", $arr); 

Standard Update
 
$data = new TNG();     
$arr = array();                   
$arr["user"] = $_POST['a4'];     
$arr["pass"] = "net";
$count=$data->update(" gallery ", $arr, " `id` = '1'","id_user='1'"); 

Standard delete

$data = new TNG();     
$count  =  $data->delete(" gallery ", " `id` = '1'","id_user='1'");