The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to display result of sql quire
hello,
I have made quire to find number of users in a usergroup and code to display number, but when i add the code to my custom vb page it won't display it: Code:
<?php // ####################### SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // #################### DEFINE IMPORTANT CONSTANTS ####################### define('NO_REGISTER_GLOBALS', 1); define('THIS_SCRIPT', 'imamac'); // 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( 'imamac', ); // pre-cache templates used by specific actions $actiontemplates = array( ); // ######################### REQUIRE BACK-END ############################ require_once('./global.php'); // ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### $res = mysql_query("SELECT username FROM user WHERE usergroupid = 2") or die("Error: ".mysql_error()); $numRows = mysql_num_rows($res); // Here you get the number of rows returned echo "There are currently $numRows users"; $navbits = array(); $navbits[$parent] = 'Im a Mac'; $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); eval('print_output("' . fetch_template('imamac') . '");'); ?> |
#2
|
||||
|
||||
Don't use echo. Assign the results text to a variable and spit the variable out in your template. What is in your template?
|
#3
|
|||
|
|||
Quote:
thanks |
#4
|
|||
|
|||
hmm lynne please help me
Thanks |
#5
|
||||
|
||||
I asked to see what was in your template but you haven't posted it.
Here's an example of what I mean by don't use echo. You have: PHP Code:
PHP Code:
And then put $myvar in your template. |
#6
|
|||
|
|||
Quote:
Thanks for help |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|