Hi All,
i have a base class in which i want constructor (function base) to have one query.
then i want to use the query result inside the other functions without having to query again.
i somehow dont get it to work.
class base
{
var $id;
function base($id)
{
$getuserdata = mysql_query("SELECT * FROM users WHERE user_id = '".$id."'");
$user = mysql_fetch_array($getuserdata);
}
function userinfo()
{
/*
here i want to use $user to display part of the result
for example $user[name'] and $user[cashtotal]
*/
}
function whatever()
{
// perform some calculations with $user[whatever]
}
}
any help apreciated, thnx in advance
Arjan