php sql update row code example
Example 1: update php sql
$_old_username = "Randy";
$_new_username = $_POST["username"];
$_sql = "UPDATE user SET first_name = $_new_username WHERE first_name = $_old_username";
Example 2: php mysql update all rows in table new values
$idresult = $conn->query("SELECT id FROM pictures");
while ($row = $idresult->fetch_assoc()){
mysqli_query($conn, "UPDATE pictures SET UniqueKey = '$UniqueKey' WHERE id = " . $row['id'];
}