vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Query causing MySQL server has gone away (https://vborg.vbsupport.ru/showthread.php?t=323983)

zero477 12-06-2016 08:00 PM

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 



Dave 12-06-2016 08:06 PM

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

zero477 12-06-2016 08:10 PM

Thanks Dave!!

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

Quote:

Originally Posted by Dave (Post 2579195)
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?

Dave 12-06-2016 08:30 PM

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?

zero477 12-06-2016 10:30 PM

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

Dave 12-06-2016 10:51 PM

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.

zero477 12-06-2016 11:11 PM

Quote:

Originally Posted by Dave (Post 2579201)
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)


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