In some cases, we may want to update table data using update sql statement. Lets see how can we update.
The table which I am using to update record is as below. The table name is emp_info
In the above table, lets say, I want to update the emp_name from Vivek to Birju whose id is 3.
If you have understanding of mysqli insert statement then following code is just a piece of cake for you. I have already discussed about insert statement. So check that tutorial.
$sql=”update emp_info set emp_name=’Birju’ where id=3″;
echo “Updated successfully”;
echo “Failed to Update”;
Output: Updated uccessfully