Custom Search

News World

Oct 25, 2008

PHP Script : Section 07 : How to Delete Record From Table with PHP Script

// create field : idcu, cname, cstatus
// coreate content
// idcu, cname, cstatus
// 1, eric lee, open
// 2, janet, close
// 3, jean van, open
// 4, hendry, open



require('./config/config.inc.php');
$tbusr_sql = mysql_query("select * from c_user");
$rtbusr_sql = mysql_num_rows($tbusr_sql);
echo "Total record : ".$rtbusr_sql;
for ($i=1;$i<=$rtbusr_sql;$i++){
$dt_tbusr_sql = mysql_fetch_array($tbusr_sql);
echo "[a title="Delete" href="?vna="" vst=".$dt_tbusr_sql[cstatus]." vid=".$dt_tbusr_sql[idcu]."> delete /a] "; echo "User : ".$i." : ".$dt_tbusr_sql[cname]."
";
}
if($vna!=''){
mysql_query("delete from c_user where cname='".$vna."' and idcu='".$vid."'");
?>

}
?>


more : web.solusi@gmail.com

No comments:

IT Conversations

Moneycontrol Latest News

Latest new pages on Computer Hope

Latest from Infoworld

Door Lock

Door Lock Import Top Door Lock from China Contact Quality Manufacturers Now