Php message board content deletion code
Script ec (2); script
$ Lianjie = mysql_connect ("localhost", "root", "xiaolie") or die ("connection failed ");
Mysql_query ("set names utf8 ");
If ($ lianjie)
{
Mysql_select_db ("xiaolie ");
If ($ _ GET)
{
$ A = $ _ GET ["id"];
$ SC = "delete from zhuce where id = $ ";
$ Fasong = mysql_query ($ SC) or die (mysql_error ());
If ($ fasong)
Echo "the record has been successfully deleted and the record is deleted ";
Else
Echo "An error occurred while deleting the record.
Return ";
}
Else
{
$ Fasong = mysql_query ("select * from zhuce") or die (mysql_error ());
Echo"
| No. |
User Name |
Gender |
Age |
Registration Time |
Operation |
";While ($ nr = mysql_fetch_array ($ fasong )){Echo"
| ". $ Nr [" id "]." |
". $ Nr [" name "]." |
". $ Nr [" xingbie "]." |
". $ Nr [" nianling "]." |
". $ Nr [" zc_shijian "]." |
Delete |
";}Echo"
";
}
}
?>