Front desk
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">Manage pages
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">Delete Processing
<?php$id=$_get["id"]; $db =new mysqli ("localhost", "root", "", "1");! Mysqli_connect_error () or Die ("Connection Error"), $sql = "Delete from house where id= ' {$id} '"; $result = $db->query ($sql); if ($ Result) {header ("location:houtaixianshi.php");} Else{echo "Connection Failed";}
Add a page
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
Add Management
<?php$keyword=$_post["keyword"]; $area =$_post["area"; $squaremeter =$_post["Squaremeter"]; $rent =$_post["Rent" ]; $renttype =$_post["Renttype"]; $housetype =$_post["Housetype"];//Build connection $db=new mysqli ("localhost", "root", "", "1") ;//test Connection!mysqli_connect_error () or Die ("Connection Error"),//sql statement $sql= "INSERT INTO house (Keyword,area,squaremeter,rent, Renttype,housetype) VALUES (' {$keyword} ', ' {$area} ', ' {$squaremeter} ', ' {$rent} ', ' {$renttype} ', ' {$housetype} ');// Run sql$result= $db->query ($sql);//Monitor If insert is successful if ($result) {header ("location:houtaixianshi.php");} Else{echo "Insert Failed";}
Modify Page
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">Modify Processing
<?php$id=$_post["id"]; $keyword =$_post["keyword"; $area =$_post["area"]; $squaremeter =$_post["Squaremeter"];$ rent=$_post["Rent"]; $renttype =$_post["Renttype"]; $housetype =$_post["Housetype"; $db =new mysqli ("localhost", " Root "," "," 1 ");! Mysqli_connect_error () or Die ("Connection error"); $sql = "Update house set keyword= ' {$keyword} ', Area= ' {$area} ', squaremeter= ' {$ Squaremeter} ', rent= ' {$rent} ', renttype= ' {$renttype} ', housetype= ' {$housetype} ' where id= ' {$id} '; $result = $db Query ($sql), if ($result) {header ("location:houtaixianshi.php");} else{ echo "modification failed";}
Instance five rent House