Hello there - is it possible to add custom data to the results so it can be used the same as the $results being returned?

ie i'd like to add a random number to the results;

$recordSet = mysql_query($sql,$this->conn);
$results = array();
while ($row = mysql_fetch_assoc($recordSet)){
    $results[]=$row;
    /// add to results[] a custom field and value, ie 'random' = 1000
}

return $results;

and then i can use it the same as;

foreach($results as $res) $title = $res['title'], $random = $res['random']; 

?

    ok - it was really straight forward!

    while ($row = mysql_fetch_assoc($recordSet)){
    $row['random'] = rand() * 1000;
    $results[] = $row;

    }

      Write a Reply...