Hi there folks,
Is it possible to code a function without the use of the global var?
<?
// basic mysql class
$db = new db();
$db->connect();
function users() {
//global $db; << can it be done without this global var.
$query = $db->query("SELECT COUNT(id) FROM login");
while ($users = $db->fetch_row($query)) {
echo $users[0];
}
}
?>
I have given it a fair go without any luck or creating a monster.
Any help appreciated, thanks folks.