亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

PHP? ??? ?? ??? ???? ???? ?? ?? ??? ??? ?????.

?? ????? PHP? ???? ??? ?? ??? ???? ?? ?? ???? ???? ?? ?? ???

?? "??"? ???? ?? ?? ???? ?? ???? ??? ???? ??? ??????.

? ????? PHP ??? ?? ?? ?? ???? ?? ? ?? ??? ???? ??? ?????.

1609.png

?? ?????? ???? ? ???? ???? ???.

<?php
$link = mysqli_connect('localhost','uesename','password','test');
    mysqli_set_charset($link, "utf8");
if (!$link) {
  die("連接失敗:".mysqli_connect_error());
}
?>

POST? ???? ?? ?????. ????? ??, ???, ?? ???

<?php
$id = isset($_POST['id'])?$_POST['id']:"";      //獲取id的值

$title = isset($_POST['title'])?$_POST['title']:"";

$author = isset($_POST['author'])?$_POST['author']:"";

$content = isset($_POST['content'])?$_POST['content']:"";
?>

?? ????? ?????. SQL ? : ??? ?? ??? ??? ? ??? ???? ????

<?php
$sql="update new set title = '$title',author = '$author',content = '$content' where id = '$id'";
//echo $sql;
$rel=mysqli_query($link,$sql);//執(zhí)行sql語句
//echo $rel
?>

update.php ?? ??:

<?php
  header("content-type:text/html;charset=utf-8");
  $link = mysqli_connect('localhost','username','password','test');
      mysqli_set_charset($link, "utf8");
  if (!$link) {
    die("連接失敗:".mysqli_connect_error());
  }
  
  $id = isset($_POST['id'])?$_POST['id']:"";
    $title = isset($_POST['title'])?$_POST['title']:"";
    $author = isset($_POST['author'])?$_POST['author']:"";
    $content = isset($_POST['content'])?$_POST['content']:"";
    
    $sql="update new set title = '$title',author = '$author',content = '$content' where id = '$id'";
    //echo $sql;
    $rel=mysqli_query($link,$sql);//執(zhí)行sql語句
    //echo $rel
  
  if($rel){
    echo "<script>alert('新聞修改成功');window.location.href='list.php'</script>";
  }else{
    echo "<script>alert('新聞修改失敗');window.location.href='edit.php'</script>";
  }
?>


?? PHP? ??? ??? ?? ??? ???? ??? ?????. ???? ? ?? ?? ???? ?? ???? ??? ??? ?? ?? ???? ??, ??, ??, ??? ? ?? ??? ???? ??? ?? ? ????.

??: ? ?? ??? ??? ??? ??? ?? ???? ??? ?????? ?? ??? ? ????.

???? ??
||
<?php header("content-type:text/html;charset=utf-8"); $link = mysqli_connect('localhost','username','password','test'); mysqli_set_charset($link, "utf8"); if (!$link) { die("連接失敗:".mysqli_connect_error()); } $id = isset($_POST['id'])?$_POST['id']:""; $title = isset($_POST['title'])?$_POST['title']:""; $author = isset($_POST['author'])?$_POST['author']:""; $content = isset($_POST['content'])?$_POST['content']:""; $sql="update new set title = '$title',author = '$author',content = '$content' where id = '$id'"; //echo $sql; $rel=mysqli_query($link,$sql);//執(zhí)行sql語句 //echo $rel if($rel){ echo "<script>alert('新聞修改成功');window.location.href='list.php'</script>"; }else{ echo "<script>alert('新聞修改失敗');window.location.href='edit.php'</script>"; } ?>