Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 12-06-2016, 08:00 PM
zero477 zero477 is offline
 
Join Date: Jan 2012
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Query causing MySQL server has gone away

Any idea of why this query is causing the error:

PHP Code:
Database error in vBulletin 4.2.3:

Invalid SQL:

SELECT

pollvote
.voteoption,

pollvote.userid

FROM pollvote

WHERE

pollvote
.pollid '2'

AND pollvote.userid != '1'

AND pollvote.voteoption <= '3'

LIMIT 4;



MySQL Error   MySQL server has gone away

Error Number  
2006

Request Date  
TuesdayDecember 6th 2016 03:32:52 PM

Error Date    
TuesdayDecember 6th 2016 03:33:27 PM



Referrer      
:

IP Address    52.5.133.46

Username      
No registrado

Classname     
vB_Database_MySQLi

MySQL Version 

Reply With Quote
  #2  
Old 12-06-2016, 08:06 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There are many things that could cause this, refer to the list at: http://dev.mysql.com/doc/refman/5.7/en/gone-away.html
Reply With Quote
Благодарность от:
zero477
  #3  
Old 12-06-2016, 08:10 PM
zero477 zero477 is offline
 
Join Date: Jan 2012
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Dave!!

--------------- Added [DATE]1481062567[/DATE] at [TIME]1481062567[/TIME] ---------------

Quote:
Originally Posted by Dave View Post
There are many things that could cause this, refer to the list at: http://dev.mysql.com/doc/refman/5.7/en/gone-away.html
Hello Dave,

Following your adivce I saw this in the link you provided:

"You tried to run a query after closing the connection to the server. This indicates a logic error in the application that should be corrected."

I have some widgets that connect to a different DATABASE that the one that has vbulletin. Maybe this is why the error is happening.

Do you know what happens if I connect to another database in a widget and then in another use vbulletin's database class to do the query?

I use vbulletin's database class to do the query that.

What logic should I use in these widgets that connect to external databases?
Reply With Quote
  #4  
Old 12-06-2016, 08:30 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Multiple database connections should work fine, unless the code of the widget closes the database connection of vBulletin. If you disable the widget, does it work?
Reply With Quote
  #5  
Old 12-06-2016, 10:30 PM
zero477 zero477 is offline
 
Join Date: Jan 2012
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello dave,

Thanks again for your quick response.

It normally works (with or without the widget), sometimes i get an email from vbulletin alerting me about this error. But it usually works.

Greetings,
Eddie
Reply With Quote
  #6  
Old 12-06-2016, 10:51 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If it's an inconsistent problem then your widgets might not be the cause. Are those widgets sidebar blocks or something else? Try setting cache time to 0 (no caching) and see what happens.
Reply With Quote
  #7  
Old 12-06-2016, 11:11 PM
zero477 zero477 is offline
 
Join Date: Jan 2012
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
If it's an inconsistent problem then your widgets might not be the cause. Are those widgets sidebar blocks or something else? Try setting cache time to 0 (no caching) and see what happens.
I currently do not catch. I will try setting up it with catching an see if that makes the fix!

Alstublieft again Dave! (I have seen your site, you look like a great developer. I lived in Groningen for 2 years and now live in Mexico I will keep in touch)
Reply With Quote
Reply

Thread Tools
Display Modes

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 03:23 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.04438 seconds
  • Memory Usage 2,222KB
  • Queries Executed 11 (?)
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
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (1)post_thanks_box_bit
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete