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

PHP develops simple voting system administrator function module (1)

115.png

There is a modify title button at the head of the simple voting system, which is used by the administrator to modify the voting theme after logging in.

The main idea is to first change the title in the database The existing title content is output through the SQL statement SELECT query and displayed in the title box.

Modify the title content directly in the title box. After clicking "Title Modification", modify the database title content directly through the SQL statement UPDATE statement.

In the previous section we created a database table votetitle and added a piece of content.

<?php
$SQL = "INSERT INTO votetitle VALUES ('1', '您認(rèn)為本網(wǎng)站還有那些要做調(diào)整?');"
?>

Query this statement through the SQL statement and display it in the modify <input> box through <input valua =" content"> output

<?php
$sql="select * from votetitle";
$rs=mysqli_query($link,$sql);
$rows=mysqli_fetch_assoc($rs);
?>

Through <input valua = "Content">Output

<input name="title" type="text" id="title" size="35" value="<?php echo $rows["votetitle"]?>" />

A submit is required here.

<input type="submit" name="Submit" value="修改標(biāo)題" />

Modify the database title content through the SQL statement UPDATE statement

<?php
if(isset($_POST["Submit"]))
{
$title=$_POST["title"];
$sql="update votetitle set votetitle='$title'";
mysqli_query($link,$sql);
}
?>

  <script language="javascript">
    alert("修改成功");
  </script>


Continuing Learning
||
<?php if(isset($_POST["Submit"])) { $title=$_POST["title"]; $sql="update votetitle set votetitle='$title'"; mysqli_query($link,$sql); } ?>
submitReset Code