Hello guys,
Why will edit never work for me? I have the following code but it always returns an error similar to this:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UDPATE sitebans SET url='eee', reason='This isnt a weight loss website..', by=' at line 1
here is my code:
$new_url = $_POST['new_url'];
$new_reason = $_POST['new_reason'];
$new_by = $_POST['new_by'];
$updateQuery = "UDPATE sitebans SET url='$new_url', reason='$new_reason', `by`='$new_by' WHERE id='$id'";
mysql_query($updateQuery) or die(mysql_error());
echo '<div align="center" class="style2">Changes saved! You may close this window..</div>';
I know by is a reserved word by I used `` so it should work.. I can never use update... please help 🙁