- First build the database in Navicat, then build the Php.web file under Project folder model and introduce Include_once (ROOT. '/library_easy/mysqlhelper.php ');
<?php// Include_once (ROOT. '/library_easy/mysqlhelper.php ');//fixed notation Class Messagelist extends Mysqlhelper { Public Function __construct () { Parent::__construct ("message_list");//Consistent with database } } ?> |
2. In the Project new folder text, under the folder to build files Php.web
Include_once '. /library_easy/config_self.php '; Include_once '. /model/message. php '; Stafflist::islogin (); Determine if login is not open |
3. Increase Append
$username =new messagelist ();//Instantiate an object $username ['my_id'];//database ID settings self-increment $username ['username']=bonly8; $username [' Passage ']=123456; $username->append ()->submit (); |
Remove Delete
$username =new messagelist ();//Instantiate an object $username->delete ()->where ('my_id=6')->submit (); |
Modify Update
$username =new messagelist ();//Instantiate an object $username [' Password ']=334456;//to modify the id=6 data password This column has a value of 334456 $username->update ()->where ('my_id=6')->submit (); |
Inquire
$username =new messagelist ();//Instantiate an object $username->select ()->where ('my_id=6')->get_first_rows (); echo $username [' username '];//output |
Output in ascending order
$username =new messagelist ();//Instantiate an object $username->select ()->get_page_asc (' my_id ');//output in ascending order <?php while ($username->for_in_rows ()) { echo $username [' my_id ']; echo $username [' username ']; echo $username [' Password ']; ?> |
PHP development process using RSS framework