This article is mainly for everyone in detail about the PHP rental data management and search page related information, with a certain reference value, interested in small partners can refer to
PHP Data Access Example: Rental information management, the specific contents are as follows
1. Database Building Tables
2. zufangzi.php
<body>
The referenced encapsulation class
<?phpclass dbda{public $host = "localhost"; Public $uid = "root"; Public $pwd = "123"; Public $dbname = "test_123"; The Execute SQL statement returns the corresponding result //$sql The SQL statement to execute //$type represents the type of SQL statement, 0 for adding and removing, 1 for querying function query ($sql, $type =1) { $db = new Mysqli ($this->host, $this->uid, $this->pwd, $this->dbname); $result = $db->query ($sql); if ($type) { //If it is a query, display the data return $result->fetch_all (); } else { //If additions and deletions are changed, return True or False to return $result; }}}
Render page