vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Should this query work? (https://vborg.vbsupport.ru/showthread.php?t=96843)

pyro.699 09-24-2005 10:13 PM

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!

Marco van Herwaarden 09-25-2005 04:52 AM

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?

pyro.699 09-25-2005 12:26 PM

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?

Marco van Herwaarden 09-25-2005 08:23 PM

well i don't see an error in the code, so i suppose it is a logic error somewhere.

pyro.699 09-25-2005 08:35 PM

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

coudl i send you my php code... and you see y its not working?

Marco van Herwaarden 09-25-2005 08:37 PM

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. :D

Sorry no time for that until wednesday. If you still have problems by then, sent me a PM.

pyro.699 09-25-2005 09:02 PM

ok, i probally will, i have spent the last 5 hours trying 2 debug it, and thats only 2day...

Paul M 09-25-2005 09:20 PM

The query to update 'resume' will never be run as you have it after the redirect.

pyro.699 09-25-2005 09:37 PM

oh, ok, thanks!! how do i do that? woulden ti ahve to edit index.php? to be like index.php?=resume or something?

Guest190829 09-25-2005 09:44 PM

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') . '");'); 



All times are GMT. The time now is 07:12 PM.

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.02359 seconds
  • Memory Usage 1,756KB
  • 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
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete