![]() |
Using loops in custom pages.
I'm using https://vborg.vbsupport.ru/showthread.php?t=62164 to creat my own custom page. I've changed some parts thoo. I use this code instead.
Code:
eval('$HTML = "' . fetch_template($templatename) . '";'); Code:
if ($_REQUEST['do'] == 'addrequest') { I would like the $test variable in the template to print out the result from "SELECT * FROM " . TABLE_PREFIX . "jobs". And perhaps some html around the result itself. Like. <div>$test</div><div>$test</div> etc.. Anyone know how to do that? :p |
You need to use two templates. The first one formats the individual records. The second one outputs the final result.
PHP Code:
HTML Code:
<div>$sub['test']</div> HTML Code:
My Results |
Quote:
|
Quote:
|
Ok, yet another problem. I would like to print out 6 categories from the databas.
Code:
$result = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "jobs WHERE act = 1"); Code:
$resultRequest = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "jobs WHERE act = 0 and category = '". $category['category'] ."' LIMIT 5"); Code:
+-----------------------+-----------------------+-----------------------+ |
All times are GMT. The time now is 03:31 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:
|