The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to query custom table
I created a custom mysql table using a separate prefix and I wrote a plugin to read from it in vB, but when I do:
PHP Code:
Code:
Invalid SQL: SELECT some_field FROM my_custom_table WHERE some_field = 'some value'; MySQL Error : Table 'vb.my_custom_table' doesn't exist Even though when I am in mysql CLI as the vb database user and: Code:
mysql> select * from my_custom_table; +------------+ | some_field | +------------+ | foo | +------------+ 1 row in set (0.00 sec) |
#2
|
||||
|
||||
Quote:
Can you try this? PHP Code:
Code:
. TABLE_PREFIX . |
#3
|
|||
|
|||
This does/will not work because I am pretty sure TABLE_PREFIX points to the $config['Database']['tableprefix'] value.
It looks like vbulletin is unable to query any tables except its own. Unless there is some sort of tablenamespace cache I have to flush. (I'm not using any caching just the normal mysqli to a single mysql server setup). |
#4
|
||||
|
||||
Quote:
The error you got is, as I mentioned above, that your custom table is using a prefix and when the query is run, it doesn''t find it. Or enter the full table name with the prefix included in the query. |
#5
|
|||
|
|||
Quote:
But even if I created vbmy_custom_table, and called .TABLE_PREFIX. it does not find the table... |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|