How to Update and Delete Data From Database table using Tinker.

How to Update Data in the Database table.

We use the update command to update the data in the database table.

Syntax

Suppose, I want to update my row whose ID no. is 20. I’m added my id and id no. in where condition and the data which I want to update is written under Update method. After hitting enter, if it returns 1 then it’s true, means data updated in the database. See below:-

The above command shows that I updated the E-mail and Name of the row whose id is 20.

Note:- If we can’t write where condition, then it will update the given data to all the E-mail and Names.

How to Delete Data From Database table.

We use the Delete command to Delete the data from the database table.

Syntax

Suppose, I want to Delete my row whose ID no. is 20. I’m added my id and id no. in where condition calls Delete method. After hitting enter, if it returns 1 then it’s true, means data Deleted from the database. See below:-

The above command shows that I deleted the row whose id is 20.

Note:- If we can’t write where condition, then it will Delete all the data from the table.