Im having a problem getting mysql_affected_rows to work properly in this syntax
, The record exist's , and is being deleted by the query , but will not return mysql_affected_rows as 1
In this code , the record gets deleted from SQL , but then jumps to this screen
Warning: mysql_affected_rows(): supplied argument is not a valid MySQL-Link resource in /home/traxxity/public_html/note_unsend.php on line 22
code is as follows ..
if(isset($_GET['noteid']) AND !empty($_GET['noteid'])) {
$sess_user = $_SESSION['username'];
$note_id = $_GET['noteid'];
$sql = "DELETE FROM `shocc_notes` WHERE `from` = '$sess_user' AND `note_id` = '$note_id' LIMIT 1";
$query = mysql_query($sql) or die(mysql_error());
$result = mysql_affected_rows($query);
if($result) {
header("Location: /notes.php?inbox=sent&status=unsent");
exit();
}
}
Where did i go wrong?
Thanks