$conn = mysql_connect("localhost","root","123");/*数据库*/
mysql_query("set names gb2312");
$db = mysql_select_db("miaolaor");
$sql="select * from news_listing where news_id='$_get[aid]'";
$query=mysql_query($sql);
if($_post['submit'])
$sql="update news_listing set news_headline='$_post[news_headline]',news_intro='$_post[news_intro]',content='$_post[content]' where news_id='$_post[aid]'";
//$sql = 'update `news_listing` set `news_headline` = \'$news_headline\', `news_intro` = \'$news_intro\', `content` = \'$content\' where `news_listing`.`news_id` = \'$news_id\' ;';
mysql_query($sql);//执行sql语句
if($sql){
echo "修改成功";
echo "返回";
}else{
echo "修改失败";
echo "返回";
}
//echo $sql;
?>
mysql_query($sql) or die(mysql_error());//执行sql语句
把SQL 语句放到数据库执行就知道了
改成
if(isset($_POST["submit"])
试试
提示什么错误了吗?把报错信息贴出来
已经弄好了 谢谢!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号