1 Star2 Stars3 Stars4 Stars5 Stars (12 votes, average: 5.00 out of 5)

Update a Database in PHP MySqli

To Update a Database in PHP MySqli you will have to make sure that the following steps have been taken.

  1. You Created A Database
  2. You Granted Privileges to the database
  3. Created a config.php file to access the database
  4. Make sure you Connect to a Database before using this code.

The purpose of updating a database is that you will make the information within the database different. You will be updating values within a table row. This is different than inserting into a database. You will actually change whatever value is in there.

Tip: Click on images to make them larger. If you find anything wrong on this page or need further assistance please comment below or contact me. 🙂
 mysqli_query($con,"UPDATE table SET row1='$var'
WHERE username='$var' ");

Update a Database in PHP MySqli

Remember that you will have to include the config file for this to work. You can put include(‘config.php’); at the top of the file. Right below that you will have to make sure that you are using the connection code to the database code.

Update a Database in PHP MySqli was last modified: October 18th, 2015 by Maximus Mccullough

Subscribe To My YouTube Channel:

Please like, share and subscribe.

Advanced Programming Made Easy

I hope you enjoyed the article. If I was able to help you please consider a tip for the content.

One Time Tip

more tips

Reoccuring Tips


Cool People Share:
Update a Database in PHP MySqli

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.