vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   What Wrong With This Code (https://vborg.vbsupport.ru/showthread.php?t=43338)

wolfe 09-08-2002 09:55 PM

What Wrong With This Code
 
i am making a riddle answers hack

but this code is playing up

Code:


 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

wolfe 09-08-2002 09:55 PM

can u plase help :D

g-force2k2 09-08-2002 10:31 PM

well are all of your answer fields empty? regards...

g-force2k2

wolfe 09-08-2002 10:32 PM

no d00d

i have edited the post to change the answer and what it does is deletes it but it don't INSERT a new answer :( is the code right to INSERT and UPDATE and DELETE

g-force2k2 09-08-2002 10:38 PM

well it seems the answers aren't inputted correctly... else you wouldn't get the DELETE as stated by your if else statements... regards...

g-force2k2

wolfe 09-08-2002 10:39 PM

d00d it don't seem to be working :(


All times are GMT. The time now is 09:24 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01445 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete