php数据访问之增删改查操作(2)

<?php $newsid=$_POST["newsid"]; $title=$_POST["title"]; $author=$_POST["author"]; $source=$_POST["source"]; $content=$_POST["content"]; $time=date("Y-m-d",time()); $db=new MySQLi("localhost","root","","mydb"); !mysqli_connect_error() or die("联系失败!"); $sql="update news set title='{$title}',author='{$author}',source='{$source}',content='{$content}',time='{$time}' where newsid='{$newsid}'"; $result=$db->query($sql); if($result) { header ("location:Update.php"); } else { echo "修改数据失败!"; }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/67200988dd969dd66771f62621e01b77.html