![]() |
How to get info from database?
First let me explain, I have my main home page as a non-vbulletin, though I create those pages based vb templates with a guide posted here somewhere.
Now, I gave one of my members a Journalist job and he needs to be able to edit some news on that main page. I don't want to give him admincp access. What I have done is made him a page to insert news in a form that inserts into the database. Now, I would like to know how I can retrieve that data for it to show on the main page. I tried a database query, but get errors for a bad template. I tried to create a plugin (first time), but was unsuccessful. Can someone guide me to how to do this? Thanks, T. |
Quote:
|
When I put the code to query info in the database in a template I get this template error:
Quote:
And here's part of the query code: PHP Code:
|
Because you can't place PHP code in a template. It must be executed in a plugin or in the file itself. You should also use the vB $db class for all your queries -- there's an article in the Articles forum that describes the process.
|
Quote:
|
Here's the article: https://vborg.vbsupport.ru/showthread.php?t=119350
|
Nice thank you.
Is there an article on how to create plugins for retrieving data? I managed to create a plugin with this code: PHP Code:
Quote:
|
You need something like
PHP Code:
|
Thanks, it's working correctly now.
|
All times are GMT. The time now is 05:13 PM. |
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:
|