wolfe
09-08-2002, 10:55 PM
i am making a riddle answers hack
but this code is playing up
if (($threadinfo[forumid]) && $isfirst) {
if (($answer1 == '') && ($answer2 == '') && ($answer3 == '')) {
$DB_site->query("DELETE FROM riddle WHERE threadid='$threadid'");
} else {
$riddle=$DB_site->query_first("SELECT answer1,answer2,answer3 from riddle WHERE threadid=$threadid");
if (($riddle['answer1'] != '') && ($riddle['answer2'] != '') && ($riddle['answer3'] != '')) {
$DB_site->query("UPDATE riddle SET answer1='".addslashes($answer1)."',answer2='".addslashes($answer2)."',answer3='".addslashes($answer3)."' WHERE threadid='$threadid'");
} else {
$DB_site->query("INSERT INTO riddle (threadid,answer1,answer2,answer3) VALUES('$threadid','".addslashes($answer1)."','".addslashes($answer2)."'),'".addslashes($answer3)."'");
}
}
}
The problem is i am trying it out to edit the answers but it DELETES it but it won't INSERT it any ideas :D please help me
but this code is playing up
if (($threadinfo[forumid]) && $isfirst) {
if (($answer1 == '') && ($answer2 == '') && ($answer3 == '')) {
$DB_site->query("DELETE FROM riddle WHERE threadid='$threadid'");
} else {
$riddle=$DB_site->query_first("SELECT answer1,answer2,answer3 from riddle WHERE threadid=$threadid");
if (($riddle['answer1'] != '') && ($riddle['answer2'] != '') && ($riddle['answer3'] != '')) {
$DB_site->query("UPDATE riddle SET answer1='".addslashes($answer1)."',answer2='".addslashes($answer2)."',answer3='".addslashes($answer3)."' WHERE threadid='$threadid'");
} else {
$DB_site->query("INSERT INTO riddle (threadid,answer1,answer2,answer3) VALUES('$threadid','".addslashes($answer1)."','".addslashes($answer2)."'),'".addslashes($answer3)."'");
}
}
}
The problem is i am trying it out to edit the answers but it DELETES it but it won't INSERT it any ideas :D please help me