Log in

View Full Version : DB & Templates


OneShot
11-21-2005, 09:42 AM
Well, I finally got around to try my hands on converting a module I originally wrote for phpNuke to vBulletin 3.5.1.

I want to start by converting the roster system : http://www.usvn.net/modules.php?name=navpers&sw=roster including a nice ACP integration and more. Big plans so to speak. However Im currently stuck at the point on how to display the results I generate in my PHP file properly in the forum. Anybody has a nice Step-by-Step tutorial or hints on how to do that?

So basically I have a DB call in a PHP file and how can I make it appear within vBulletin? I looked over the available Tutorials here and found most of the steps, however there is something im apparently missing, so hopefully somebody can help me along.

Cheers
OS

c'mon guys (and gals) I really need some help here - I'm going ape.

$sqlroster = "SELECT callsign FROM clan_service";
$result = $db->query_first($sqlroster);
$service_name = $db->fetch_array($result);

Now the PHP part works, sort of. So I get an array -> $service_name. However I cant display the contents of it on the page. I'm currently using as basis the code from the Mod tutorial over at the 3.5 Tutorial forum for making basic pages within vB.

Again any help, even if it was "Hey dummy look at this and this thread, this question has been asked a hundred times already" would be ok. As long as I get some answers.

Thanks in Advance
OS

Marco van Herwaarden
11-21-2005, 09:01 PM
If you use query_first (as opposed to query_read), $result will alsready contain the row data, not need for a fetch anymore.

Just use $result['callsign'] in your PHP or your template.

OneShot
11-21-2005, 09:32 PM
Thanks, that did the trick.