Custom Search

News World

Oct 26, 2008

PHP Script : Section 09 : How to Update Record in the Table with PHP Script



if($vid!=''){
?>
}
// Create table : c_user
// create field : idcu, cname, cstatus
// coreate content
// idcu, cname, cstatus
// 1, eric lee, 1
// 2, janet, 0
// 3, jean van, 1
// 4, hendry, 0
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].">update /a ] ";
echo "User : ".$i." : ".$dt_tbusr_sql[cname]."
";
}

if ($_POST[cmdupdate]!=''){
mysql_query("update c_user set cstatus='".$_POST[txtstatus]."' where cname='".$_POST[txtcname]."'");
?>

}
?>

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