vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Problem with query for some users (https://vborg.vbsupport.ru/showthread.php?t=99965)

Softcore 11-03-2005 04:25 AM

Problem with query for some users
 
Hey guys,

I coded a vbulletin mod for my site, and I have a problem with It which I've looked at for hours and cannot figure out how to fix It.

You see, when a user visits the page for the first time of my mod, they are given a welcome, and asked to click a link to generate their Information In the database, well, upon clicking the link, It generates It, then updates a field In the vb user table from 0 to 1 to show they have generated their Information. It then redirects them back to the screen they started off with, which shows a form to continue on with my mod, rather then the welcome message.

Now all would be fine, but there's a problem. I've gotten about 10 users so far who've I've gotten database emails from saying duplicate row In the database, and I check the users table, and the field Is still set to 0 and not 1. So they are sitting there clicking on the Generate link over and over, when It's already added their Information, but not updated the user's table.

There has been over 300 user's who have used It, and only 10 of those have had the problem, so obviously the query Is fine for some, but not all. It seems to be a growing problem, getting 3 new user's reporting It a day or so, the number Is growing.

My question Is, why might It be failing for some and not all If there was something wrong with It?

Marco van Herwaarden 11-03-2005 03:36 PM

Impossible to tell without looking at the code.

Softcore 11-03-2005 07:39 PM

Quote:

Originally Posted by MarcoH64
Impossible to tell without looking at the code.

:nervous: should of Included that. I'll post the query that Is failing, the one above It works just fine, as well as the redirect code under It.

PHP Code:

 // Update setting In USER table
$DB_site->query("UPDATE " TABLE_PREFIX "user SET battlesetting=1 WHERE userid='$bbuserinfo[userid]'");

$_REQUEST['forceredirect'] = 1;
$url "standings.php?do=submitbattle";
eval(
print_standard_redirect('redirect_generated')); 

Note that I am not getting any database error emails about It failing, It simply just doesn't work for some people.

Guest190829 11-03-2005 10:47 PM

Try the below query...

PHP Code:

 // Update setting In USER table
$DB_site->query("UPDATE " TABLE_PREFIX "user SET battlesetting='1' 
                 WHERE userid='" 
.$bbuserinfo[userid] ."'
              "
); 



All times are GMT. The time now is 01:32 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.01000 seconds
  • Memory Usage 1,724KB
  • 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
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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