Nowadays the usage of virtual devices is increased rapidly and most of the business depends on the internet to improve their sales and marketing strategy. A website plays a major role in the growth part of a company and helps them to scale up easily. Having a good website for your company will help you in the long run to achieve the targets.
In this post, we will discuss how to develop a simple web application using PHP and MySQL. Web development involves creating a website by developing the front-end and back-end with the help of client-side and server-side languages.
Skyfi Labs gives you the easiest way to learn and build this project.
PHP - It is a server-side scripting language based on the user request the HTML files are displayed. With PHP you can create a dynamic webpage which can interact with databases. PHP can be easily connected to databases like Oracle and MySQL.
MySQL - MySQL is a database management system which is used for a wide variety of purpose includes data logging applications, e-commerce and data warehousing.
PHP and MySQL are commonly used together to create a dynamic website which interacts with the database real-time to show the categorised and searchable data to the user.
Want to develop practical skills on Web Development? Checkout our latest projects and start learning for free
Now we are going to create a web application to manage doctors and nurse. We will start by creating a server using XAMPP which installs both MySQL and PHP. You can host your web application using XAMPP with the help of AWS. Run the server create a new folder “medibed” inside the XAMPP folder.
After installing the XAMPP create a database for the web application make a simple hospital database “nurses”, “patients”, “doctors”, and “admins” with four tables. Write the SQL script for the database and save it. The database is now ready. Now we will set up the server and Admin LTE template.
Download the Admin LTE template and copy-paste the folders “browse_components” and “dist” to the “medibed” folder which is created previously. Create a layout page for the application. Write the code for the layout page and save it as “master.php”. Now create the index page and save it as index.php. Write the following code and paste it inside the index.php file.
$content = '<h2>Your Main Content Here</h2>';
Now we will perform the CRUD (Create, Read, Update, Delete) operations. AdminLTE template is used to create beautiful and responsive UI.
To perform the CRUD operations using PHP and MySQL first create a folder named “api” in the root directory and again create three folders “config”, “doctors” and “objects” inside the api folder. Inside api folder create a file database.php and paste the required code.
Now create API for CRUD operations for that first create a model of doctor by writing code on doctor.php file. Now we have CRUD operations including read_single function for reading a single doctor record from the database.
For creating new doctors make create.php file and add the required code inside it. For reading the doctors table create read.php file and add the required code. Similarly, create a file update.php to update a record. At last, create another file delete.php to perform the CRUD operations.
Now our API is ready for CRUD operations let’s create the UI and connect with the API. Create UI using AdminLTE template for our CRUD API. Create a page to display the doctor’s data in a table. Similarly, create pages to “Create”, “Update” and “Display”.
Now we have successfully created a simple web application using free UI template. You can get the complete source code from GitHub.
Skyfi Labs helps students learn practical skills by building real-world projects.
You can enrol with friends and receive kits at your doorstep
You can learn from experts, build working projects, showcase skills to the world and grab the best jobs.
Get started today!
Stay up-to-date and build projects on latest technologies