The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Creating Plugin Error when adding query
I'm writing my first plugin. I got to the point where my static code needed to be ported to the database. When I added in some simple code:
PHP Code:
Does anyone have any advice? Jay |
#2
|
|||
|
|||
It's probably a php error, and you have display_errors set to off. Just a guess, but you could try adding "global $vbulletin;" to the start of your code (depending on the hook you use, $vbulletin isn't always available unless you add that).
|
#3
|
||||
|
||||
It looks to me that you aren't querying the database, normal syntax would be "SELECT whatimlookingfor FROM mytablename WHERE whatimlookingforisin" that select 1+1 isn't a query to do anything as such.
|
#4
|
|||
|
|||
Kevin, that was it! I needed a global for connection to the database. I hope this can help someone in the future.
Thank you! And Simon, try that query on console, you'll see it is a valid query. I was doing that to make sure it wasn't my query that was messed up. Here is the result fyi: PHP Code:
|
Благодарность от: | ||
HMBeaty |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|