![]() |
Forum How to query custom database table I created a custom mysql table using a separate prefix from my vbulletin table prefix and I wrote a plugin to read from it in vB, but when I do: PHP Code: $result = $vbulletin->db->query_first_slave(" SELECT some_field FROM my_custom_table WHERE some_field = 'some value'"); It returns error: 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) The sql call fails via the "Execute a SQL Query" via admincp as well. How do I get my plugin to read my custom table? Do I have to do an end run around and create a 2nd new database connection outside of using the vB objects? |
الساعة الآن 03:26 AM |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.5.2 TranZ By
Almuhajir