Hey everybody I want to let you know that I have undertaken the grueling task of getting the heck away from WordPress. I was so sick of the problems and updates I had to do all the time. I am now using my ezbloo system and I am integrating all my old posts into the new system. It sucks, but in the end, I will save bundles of time. I needed to keep things simple and that is why I created ezbloo. I'll have more on this later for you guys after I am done with the total integration of my old posts here. So if you are looking for a post and need it faster, shoot me an email and I will make it a priority. [email protected]

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.
mysqli_query($con,"UPDATE table SET row1='$var'
WHERE username='$var' ");
OR like this.
$sql = "UPDATE MyGuests SET lastname='Doe' WHERE id=2";

if ($conn->query($sql) === TRUE) {
  echo "Record updated successfully";
} else {
  echo "Error updating record: " . $conn->error;
}
Update with prepared statements.
$stmt = $conn->prepare("UPDATE equipment SET `type` = ?, `name` = ?, `year` = ?, `value` = ? WHERE `id` = ?");
$stmt->bind_param("sisdi", $type, $name, $year, $value, $eqid);
$stmt->execute();
$stmt->close();

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.