Php rental data management and search page, php rental data management
Php Data Access example: Rental Information Management, details:
1. Create a database table
2. zufangzi. php
<Body>
Referenced encapsulation class
<? Phpclass DBDA {public $ host = "localhost"; public $ uid = "root"; public $ pwd = "123"; public $ dbname = "test_123 "; // execute the SQL statement and return the corresponding result // $ SQL statement to be executed // $ type indicates the type of the SQL statement, and 0 indicates addition, deletion, and modification, 1 indicates 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, show data return $ result-> fetch_all ();} else {// If adding, deleting, modifying, return true or false return $ result ;}}}
Rendering page
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.