PHP MySQL Update Data

Update data in mysql using php

We already know how to establish connection between PHP web application and MySQL database system in our previous PHP tutorial. we also learnt to  select data from mysql and insert data into mysql database.

Now, In this PHP tutorial we will learn how to update data into MySQL database using PHP script.

UPDATE Statement

The UPDATE Statement is used to modify the records of existing table.

UPDATE Statement Syntax

UPDATE table_name SET  col1=val1, col2=val2, col3=val3 WHERE Condition

col1, col2 – is the anme of columns which records has to be updated.
val1, val2 – is the values of new records which has be updated in to table.

learn more about mysql UPDATE statement : UPDATE Statement


PHP Example of Update data in MySQL database

 

Leave a Reply

Your email address will not be published. Required fields are marked *

8 + 3 =


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">