Table of Contents
We will discuss about how to update a record or data from MySQL database using laravel framework PHP.
To update the data in mysql table UPDATE statement is used.
We update the employee data from MySQL database using JSP.
Create four file for update data
- php (app/Http/Controllers/StudUpdateController.php)
- blade.php (resources/views/stud_edit_view.blade.php)
- php (resources/views/stud_update.php)
- php (routes/web.php)
The students table look like before update.
id | first name | last name | City name | Email Id | Action |
1 | Gpkumar | Gp | Chennai | gp@gmail.com | Edit |
2 | Praveen | Kumar | Chennai | praveen@gmail.com | Edit |
3 | Kumar | Ganesan | Chennai | kumar@gmail.com | Edit |
Update the email id of id=3 record.
stud_edit_view.blade.php
stud_update.php
StudUpdateController.php
web.php
After delete the record the table look like this.
id | first name | last name | City name | Email Id | Action |
1 | Gpkumar | Gp | Chennai | gp@gmail.com | Edit |