View Single Post
Old 07-28-2008, 07:42 PM   #6 (permalink)
Sam Granger
The Acquainted
 
Join Date: Sep 2007
Posts: 126
Thanks: 4
Sam Granger is on a distinguished road
Default

Quote:
Originally Posted by redSHIFT View Post
PHP Code:
$results_d $db->query('SELECT * FROM `results` WHERE `x` = 4 ORDER BY `the_moon`');

if(
$results_d->num_rows 1)
{
    
// blah
}
else
{
    
$users = new Template('users');
    
    
$results = array();
    while(
$result $results_d->fetch_assoc())
    {
        foreach(
$result as $key => $value)
        {
            
$results[$key] = $value;
        }
    }
    
    
$users->replace_while('results'$results);

Ok, I think this is what I'm after but the code above, lets say my query 'messageresult' returns 'title' & 'message' - how do I send both those variables to the template?
Sam Granger is offline  
Reply With Quote