新闻后台系统添加 修改 删除的php代码应该怎么写啊?高手指教下 我是初学着 !
添加:
$sql = "insert into tb_news (title,resume,addtime,content) values ('{$_post['new_title']}','{$_post['new_resume,']}','{$_post['new_addtime']}','{$_post['new_content']}')";
$rs=mysql_query($sql);
编辑:$sql="update tb_news set title='{$_post['new_title']}',resume='{$_post['new_resume']}',addtime='{$_post['new_addtime']}',content='{$_post['new_content']}' where id='{$_post['id']}'";
$rs=mysql_query($sql);
删除:$sql="delete from tb_news where id='{$_get['id']}'";
$rs=mysql_query($sql);
上面的表名跟字段名看你自己的数据设计 20210311