...

View Full Version : sql error?



mivec
05-14-2004, 06:49 AM
hi all,
i wonder what's going on. it seems fine to me but it just isn't working.here is the code:



//sent with this link
$query = "SELECT guestbook_id, contents, sender, receiver, type, date_sent, confirm, uniqueID FROM tblguestbook WHERE receiver = '".$_GET["username"]."' AND confirm=0";
$rs = mysql_query($query);
$numRows = mysql_num_rows($rs);

<tr>
<td align=\"right\" class=text><a href=\"confirm.php?id=$row->uniqueID&guestbookID=$row->guestbook_id&username=".$_GET['username']."\">[Confirm]</a></td>
</tr>




//received here
$query = "UPDATE tblguestbook SET confirm = 1 WHERE username = '".$_GET["username"]."' AND guestbook_id='".$_GET["guestbookID"]."' AND confirm = 0 AND uniqueID='".$_GET["id"]."'";
echo($query);
$rs = mysql_query($query);
$affRows = mysql_affected_rows($rs);
if ($affRows > 0){
$message = "<font color=black>SUCCESS:</font> Your Greeting Book Has Been Successfully Updated.";
}
else{
$message = "<font color=black>ERROR:</font> A problem has occured when you tried to update your greeting book. " .
"The possible reasons might be your username does not match or " .
"due to that it could've been confirmed ealier on. ";
}


but it lands on this part:



$message = "<font color=black>ERROR:</font> A problem has occured when you tried to update your greeting book. " .
"The possible reasons might be your username does not match or " .
"due to that it could've been confirmed ealier on. ";


i also tried checking the error by echoing the $query and it seems fine to me:


UPDATE tblguestbook SET confirm = 1 WHERE username = 'turbo' AND guestbook_id='1' AND confirm = 0 AND uniqueID='2323d'


i wonder what's wrong. pls advice.thank you.

V@no.
05-14-2004, 07:36 AM
And if u look into database, is there anything that matching all four conditions:
username = 'turbo' AND guestbook_id='1' AND confirm = 0 AND uniqueID='2323d'



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum