This is my first time on SO, so I'm not knowing about everything. I'm sorry. I have a problem with my site. I want to update the viewed status of one of the rows.
This is my update code:
<?php
if(isset($_POST['Submit'])){//if the submit button is clicked
$sql= mysql_query ("UPDATE system_reports SET viewed=1 WHERE id =' ".$row['id']." ' ");
$conn->query($sql) or die("Cannot update");//update or error
}
?>
But when I click on the button, I get: Cannot Update
. The connection of DB is fine. So I don't know what is the problem. ID is a realy working variable.
So is my rows working:
<?php
function spam_Draw() {
$a = mysql_query("SELECT * FROM system_reports WHERE viewed=0");
while ($row = mysql_fetch_array($a)) {
echo $row['id']." <a href='http://warrock-hack.net/profiel/".$row['user'] . "/'>Gedupeerde</a> <a href='" . $row['report_url'] . "'> Ga naar het probleem toe!</a> " . $row['reason'];
echo '<br>';
echo '<INPUT TYPE="Submit" VALUE="Update the Record" NAME="Submit"> ';
}
}
?>
I hope someone can help me out! Thanks..
Regards,
John.