![]() |
MySQL in a Plugin
I have a plugin with the following characteristics:
Hook: global_start Code: Code:
$userswith = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX . "mtweaks WHERE name='userswithimage'"); My vBulletin is version 3.6.9 and the plugin system is enabled. I also have Debug mode on. The issue at hand is the DB query is not executing. I cannot figure out why... I've tried using various references to $db ($this->registry->db, $vbulletin->db, $db, etc.) and none have seemed to work. (Some made the page fail to load) The query is valid and works in the custom ACP pages I made. Also, I've been looking at the SQL log in the debug section (the box at the bottom of pages) and it doesn't look like my query ever runs. So, I don't know why my query isn't running and I'd really appreciate some help getting it to work! |
Try the global_setup_complete hook location
|
Thanks so much for your reply, that seemed to do the trick!
|
What makes you think it wasnt running ?
FYI, sql executed in that hook is not displayed in debug mode, this is due to the output from that hook being stored in a buffer. (its a bug IMO, but Jelsoft dont seem to think so). |
All times are GMT. The time now is 07:23 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|