![]() |
How to use query result in same php file
I have this query
Code:
$ytvideo = $db->query_read("SELECT threadid FROM thread WHERE ytvideo = '$id'"); Thanks |
That's what the plugin system is for. You can use plugin hooks to call code like that from the PHP files. Open the .PHP file you want to include it in, and find a hook location for it.
|
The php file I'm working in isn't a vbulletin file. It's a project I'm working on integrated with vb. I just want to figure out how to use $ytvideoid from the code above in the file rather than in the template. Using it in the file right now it has no value, but in the template it has the correct value...
|
Then I would say the reason the variable doesn't have any value is because the variable $id isn't defined in your PHP file. You'll want to try to find a different variable for it, because that's probably defined by whatever's calling the template.
Next, your select statement isn't cool, you should do this: Code:
"SELECT threadid FROM ".TABLE_PREFIX."thread WHERE |
PHP Code:
|
All times are GMT. The time now is 03:38 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:
|