PHP MySQL Using OOPs
Working with PHP MySQL Using OOPS In this blog, you are going to learn how to connect with MySQL database and perform different CRUD operations using Oops based class in PHP. This tutorial explains to you how to create a class with some functions that are used to maintain the database. The below given example class having some methods and uses those methods in test class to perform various operations such as listing all the users, testing admin login, deleting a record and so on. TopMenu 1. Create a table - users with following fields: id username password email 2. Create dbclass.php and paste the given code below and save in some folder in server. This class having the following functions: dbconn() dbclose() dbselect() dblogin($user,$pwd) dbdelete($user) dbupdate($username,$oldpassword,$newpassword) 3. Create another file dbclasstest.php as given below and run that file in a localhost. Note: Change the db details according to yours in dbclass.php in order to connect wit