Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-19-2019, 11:12 PM
Joshua2597 Joshua2597 is offline
 
Join Date: Oct 2014
Location: Toronto
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Plugin Issues

Hello,

I am currently running 3.8.x
I am trying to install a 3.8 MOD and get this error when importing via ACP
Code:
Error: Call to undefined function mysql_query() in ..../admincp/plugin.php(2001) : eval()'d code on line 13
Trace Data:
#1 : vbstop() called in ..../includes/class_core.php on line 3834
#2 : vbulletin_exception_handler() called in  on line 

Var Type:
[ NULL ]

Var Data:
null
Reply With Quote
  #2  
Old 09-19-2019, 11:24 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This happens because the plugin doesn't call the vBulletin database interaction methods but instead calls PHP's mysql_* library methods directly.

For example mysql_query in vBulletin should be converted to $db->query_read, but it also depends on what the SQL query wants to do. An UPDATE query should be called using $db->query_write instead.
Reply With Quote
  #3  
Old 09-19-2019, 11:33 PM
Joshua2597 Joshua2597 is offline
 
Join Date: Oct 2014
Location: Toronto
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
This happens because the plugin doesn't call the vBulletin database interaction methods but instead calls PHP's mysql_* library methods directly.

For example, mysql_query in vBulletin should be converted to $db->query_read, but it also depends on what the SQL query wants to do. An UPDATE query should be called using $db->query_write instead.
When I went to run that I got this error

Code:
Static analysis:

4 errors were found during analysis.

Unexpected character. (near "$" at position 0)
Unexpected beginning of statement. (near "$" at position 0)
Unexpected beginning of statement. (near "db" at position 1)
Unexpected beginning of statement. (near "query_write" at position 5)
SQL query:

$db->query_write

MySQL said: Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$db->query_write' at line 1
Reply With Quote
  #4  
Old 09-20-2019, 10:19 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That indicates "$db->query_write" was put in the SQL query statement. The SQL query needs to be called using that function and not put in the actual statement. If you paste the pieces of code here then we might be able to supply the fix for you.
Reply With Quote
  #5  
Old 09-20-2019, 12:41 PM
Joshua2597 Joshua2597 is offline
 
Join Date: Oct 2014
Location: Toronto
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
That indicates "$db->query_write" was put in the SQL query statement. The SQL query needs to be called using that function and not put in the actual statement. If you paste the pieces of code here then we might be able to supply the fix for you.
Code:
An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$db->query_write' at line 1
Reply With Quote
  #6  
Old 09-20-2019, 01:32 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can't really do much with that, we need to see the lines of code in the plugin that are throwing the errors.
Reply With Quote
  #7  
Old 10-03-2019, 01:50 PM
Joshua2597 Joshua2597 is offline
 
Join Date: Oct 2014
Location: Toronto
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
Can't really do much with that, we need to see the lines of code in the plugin that are throwing the errors.
What do you mean by that?
Reply With Quote
  #8  
Old 10-03-2019, 01:54 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Post the code of the hook/plugin that is causing the issue here so we can tell you exactly what to change in order to fix it.
Reply With Quote
  #9  
Old 10-03-2019, 02:03 PM
Joshua2597 Joshua2597 is offline
 
Join Date: Oct 2014
Location: Toronto
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
Post the code of the hook/plugin that is causing the issue here so we can tell you exactly what to change in order to fix it.
Code is to long to post but it's this mod
https://vborg.vbsupport.ru/showthread.php?t=201274
Reply With Quote
Reply


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 09: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.04014 seconds
  • Memory Usage 2,240KB
  • 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
  • (3)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete