此代码应该使用在编辑网页上所做的更改来更新数据库中已经存在的文章,但它不起作用。它显示当前文章,但是当我进行更改并单击“保存”时,没有任何变化。
mysql_select_db("scms", $con );
$show_world="show_world";
define("IMG_URL", "http://localhost/project/show/show_home/images/");
define("ABS_PATH",dirname(__FILE__));
define("IMG_PATH",dirname(__FILE__)."/");
$id = $_GET['id'];
$sql = "select * FROM $show_world where id = $id";
$result=mysql_query($sql);
$row = mysql_fetch_array($result);
if(isset($_POST['save'])) {
$id = $_POST['id'];
$topic = $_POST['topic'];
$author = $_POST['author'];
$content = $_POST['content'];
$picture = $_POST['picture'];
$date = $_POST['date'];
$sql = "UPDATE $show_world SET topic='".$topic."',author='".$author."', content='".$content."', date='".$date."' ";