Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-24-2005, 10:13 PM
pyro.699 pyro.699 is offline
 
Join Date: Sep 2005
Location: Fredericton, New Brunswic
Posts: 261
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Should this query work?

PHP Code:
      $db->query_write("  
     UPDATE " 
TABLE_PREFIX "user  
     SET resume = '1' 
     WHERE userid = '" 
$vbulletin->userinfo['userid'] . "' 
     LIMIT 1
      "
); 
should that work?

i have a place inside the usertable called "resume" with all that crap set... whats wrong wiht it!
Reply With Quote
  #2  
Old 09-25-2005, 04:52 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The LIMIT 1 is unneeded, but harmless.

Where are you running this query? Do you get an error? What make you think it is wrong?
Reply With Quote
  #3  
Old 09-25-2005, 12:26 PM
pyro.699 pyro.699 is offline
 
Join Date: Sep 2005
Location: Fredericton, New Brunswic
Posts: 261
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

its not woorking ill show more code...

At the top:
PHP Code:
if ($vbulletin->userinfo['resume']) 

$errormessage .="Sorry, you are only aloud to submit 1 resume, if you are having troubles, please contact the admin.";
eval(
'print_output("' fetch_template('STANDARD_ERROR') . '");'); 
At Bottom:
PHP Code:
if ($_POST)
{
//#########################
//crap to make shure theres no errors...
//#########################
}
else
    {

//#################################
//Stuff for e-mail, that vb.org is not aloud 2 see :P
//#################################

//Mail it off!
    
mail("cody.woolaver@gmail.com","Resume Submitted",$message,"From: Celia.net");
//display redirect
    
$navbits = array();
    
$navbits[$parent] = 'Staff Resume';
    
$navbits construct_navbits($navbits);
    eval(
'$navbar = "' fetch_template('navbar') . '";');
    eval(
'print_output("' fetch_template('PYRO_REDIRECT') . '");');
//set query
     
$db->query_write("  
     UPDATE " 
TABLE_PREFIX "user  
     SET resume = '1' 
     WHERE userid = '" 
$vbulletin->userinfo['userid'] . "' 
     LIMIT 1
      "

ok, after i hit submit, it takes me 2 the redirect page, fine... i go back, redo it, click submit, and it still allows em 2 submit it...
i made a table inside "user" called "resume", int(1)"

now, shoudlent that work?
Reply With Quote
  #4  
Old 09-25-2005, 08:23 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well i don't see an error in the code, so i suppose it is a logic error somewhere.
Reply With Quote
  #5  
Old 09-25-2005, 08:35 PM
pyro.699 pyro.699 is offline
 
Join Date: Sep 2005
Location: Fredericton, New Brunswic
Posts: 261
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

crap!!!! hey 1 more and you 5k posts! congrats...

coudl i send you my php code... and you see y its not working?
Reply With Quote
  #6  
Old 09-25-2005, 08:37 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by pyro.699
crap!!!! hey 1 more and you 5k posts! congrats...
Oops didn't even notice that, but already too late it seems.

Sorry no time for that until wednesday. If you still have problems by then, sent me a PM.
Reply With Quote
  #7  
Old 09-25-2005, 09:02 PM
pyro.699 pyro.699 is offline
 
Join Date: Sep 2005
Location: Fredericton, New Brunswic
Posts: 261
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, i probally will, i have spent the last 5 hours trying 2 debug it, and thats only 2day...
Reply With Quote
  #8  
Old 09-25-2005, 09:20 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The query to update 'resume' will never be run as you have it after the redirect.
Reply With Quote
  #9  
Old 09-25-2005, 09:37 PM
pyro.699 pyro.699 is offline
 
Join Date: Sep 2005
Location: Fredericton, New Brunswic
Posts: 261
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oh, ok, thanks!! how do i do that? woulden ti ahve to edit index.php? to be like index.php?=resume or something?
Reply With Quote
  #10  
Old 09-25-2005, 09:44 PM
Guest190829
Guest
 
Posts: n/a
Default

I think he means changing your code to this...

PHP Code:
 if ($_POST)
{
//#########################
//crap to make shure theres no errors...
//#########################
}
else
    {

//#################################
//Stuff for e-mail, that vb.org is not aloud 2 see :P
//#################################

//Mail it off!
    
mail("cody.woolaver@gmail.com","Resume Submitted",$message,"From: Celia.net");
//display redirect
    
$navbits = array();
    
$navbits[$parent] = 'Staff Resume';
    
$navbits construct_navbits($navbits);
eval(
'$navbar = "' fetch_template('navbar') . '";');
  
// set query
 
$db->query_write("  
     UPDATE " 
TABLE_PREFIX "user  
     SET resume = '1' 
     WHERE userid = '" 
$vbulletin->userinfo['userid'] . "' 
     LIMIT 1
      "
);
//redirect...
       
eval('print_output("' fetch_template('PYRO_REDIRECT') . '");'); 
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:46 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.03896 seconds
  • Memory Usage 2,266KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (9)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete