Currently, I am using PHP to get some from the backend and insert into the database using mysqli. Below is the code used:
$conn = new mysqli('localhost', 'username', 'pwd', 'db');
// check connection
if (mysqli_connect_errno()) {
exit('Connect failed: '. mysqli_connect_error());
}
$sql = "INSERT INTO `birthday` (`birthday`) VALUES ('$birthday')";
// Performs the $sql query and get the auto ID
if ($conn->query($sql) === TRUE) {
echo 'The auto ID is: '. $conn->insert_id;
}
else {
echo 'Error: '. $conn->error;
}
Now if I am going to fetch the information again, how to I update this value? Currently, it will create another row and insert the value again.
Thanks In Advance