vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Plugin Issues (https://vborg.vbsupport.ru/showthread.php?t=327545)

Joshua2597 09-19-2019 11:12 PM

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


Dave 09-19-2019 11:24 PM

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.

Joshua2597 09-19-2019 11:33 PM

Quote:

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


Dave 09-20-2019 10:19 AM

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.

Joshua2597 09-20-2019 12:41 PM

Quote:

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


Dave 09-20-2019 01:32 PM

Can't really do much with that, we need to see the lines of code in the plugin that are throwing the errors.

Joshua2597 10-03-2019 01:50 PM

Quote:

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

Dave 10-03-2019 01:54 PM

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.

Joshua2597 10-03-2019 02:03 PM

Quote:

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


All times are GMT. The time now is 11:30 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.02299 seconds
  • Memory Usage 1,731KB
  • 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
  • (3)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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