i am attempting to build my first vb powered page via this tutorial:
https://vborg.vbsupport.ru/showthread.php?t=62164
everything from that tut is working fine but i am running a query and cant seem to access the results in a template.
basically this is what i have:
PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'contest_stats'); // change this depending on your filename
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();
// get special data templates from the datastore
$specialtemplates = array();
// pre-cache templates used by all actions
$globaltemplates = array(
'contest_stats',
);
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
$startdate = 1112313600;
$enddate = 1114819200;
$get_thread_stats = "<a href=\"contest_stats.php?do=stats&type=threads\">Get Thread Starter Stats</a>";
if ($_REQUEST['do'] == "stats") {
// user has requested stats so get them
// chould we get most threads started, most posts or most referrals?
if ($_REQUEST['type'] == "threads") {
$most_threads = "";
$threads = $DB_site->query_first("
SELECT postusername
FROM " . TABLE_PREFIX . "thread");
while ($row = $DB_site->fetch_array($threads)) {
$most_threads .= $row['postusername'] . "<br />";
}
} elseif ($_REQUEST['type'] == "posts") {
} elseif ($_REQUEST['type'] == "referrals") {
}
}
$navbits = array();
$navbits[$parent] = 'Contest Statistics';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('contest_stats') . '");');
?>
template
HTML Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header
$navbar
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat">Title</td>
</tr>
<tr>
<td class="alt1">
$get_thread_stats
<br />
$most_threads
<br />
$row[postusername]
</td>
</tr>
</table>
$footer
</body>
</html>
i have $most_threads and $row[postusername] but still no luck.
any ideas how i can access my query results?
thanks
eric