Code:
if (!empty($delete)) {
$query = "DELETE FROM items WHERE id=" . $delete;
$result = @mysql_query($query);
if (mysql_affected_rows($result) == 1) {
echo "Deleted";
}
}
It's weird. The delete query works and succesfully deletes the item, but it says "Warning: mysql_affected_rows(): supplied argument is not a valid MySQL-Link resource in code.php" and it doesn't say "deleted" even though it was succesfully deleted from the database.
If I do "if ($result)" then it says "Deleted" whenever it succesfully runs the query, which doesn't necessarily means it deleted one.
The one way I can see around this is running a select query before deleting it.
edit: Well I ended up doing that (adding select query before). You can delete this now.
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --