View Full Version : Should this query work?
pyro.699
09-24-2005, 10:13 PM
$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:
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:
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
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...
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') . '");');
pyro.699
09-25-2005, 10:09 PM
//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') . '");');
i replaced what i had with this, and it just gave me a white screen, when i went to submit again, it gave me my error :P
so, its just not desplaying my redirect page...
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.