I would need help on this problem:
I would like to create a PHP button that updates the value of a field in a table.
Example: Patient Table - Test Field (the test content is currently YES) I would like to change the content in all the records with the NO value.
I wrote the following PHP code inside the PHP button, but I get an error message:
------------------------------------------------------------ <?php
// I prepare the update query
$query = “UPDATE pazienti SET test = ‘NO’”;
// sending the query
$result = mysql_query($query);
// check the result
if (!$result) {
die("Errore in Azzeramento $query: " . mysql_error());
}
echo ‘Azzeramento eseguito correttamente’;
?>
If I execute the sql command in phpmyadmin (UPDATE patients SET test = ‘NO’) it works. I can not understand where I’m wrong, thanks for your help