The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Widget Issue (DB Query)
So I'm attempting to make a widget that greets my new members and encourages my veteran members to greet my new members. For some reason I get an error with my DB query, I'm sure it's a pretty simple fix and it's just error on my part but I can't seem to figure it out.
Here is my code: PHP Code:
It pulls this lovely Error as well: Code:
Fatal error: Call to a member function query_first() on a non-object in /*****/*****/public_html/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 4 I've look around, in fact I used this page to assist me in doing the query. Any help would be immensely appreciated. Thank you. |
#2
|
|||
|
|||
I would escape the variables in the SQL query and use vB:: for the database calls as well. You can try the following:
PHP Code:
|
#3
|
||||
|
||||
Hmm...got this odd error now.
Code:
PHP Warning: mysqli_query(): (42000/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 'AND usergroupid NOT IN (3,4,8,17)' at line 1 in ..../includes/class_core.php on line 1433 Fatal error: Class 'SQLiteDatabase' not found in /*****/*****/public_html/includes/class_core.php on line 1182 |
#4
|
|||
|
|||
First error probably happens because $members['maxid'] is empty/doesn't contain anything in your code snippet.
Second error is rather weird, vBulletin doesn't make use of SQLite at all. What database type did you configure in your includes/config.php file? |
#5
|
||||
|
||||
Hmm...seems like $members['maxid'] isn't a valid variable for some reason. Any ideas on how I would get the desired effect of getting the username and userid of the newest registered member?
|
#6
|
||||
|
||||
Try running the following query:
PHP Code:
|
#7
|
||||
|
||||
Attempted it, got a new error:
Code:
Fatal error: Call to a member function query_read_slave() on a non-object in /*****/******/public_html/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 4 |
#8
|
||||
|
||||
Quote:
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|