yep, but how do you return the fields? yet
again in an array? not that helpfull is it?
Actually for good OOP programming you would use an object.
$1stname = get_firstname($cookie_id);
You would suggest something like
$visitor = get_allinformation($cookie_id);
where $visitor[1stname] contains the needed
1stname?
Instead, you would use something like this:
class Visitor
{
var $FirstName;
var $LastName;
var $Email;
}
function getVisitor($cookie_id)
{
// query your database and get your values
// then create your object and populate it
$retval = new Visitor;
$retval->FirstName = [your db value];
$retval->LastName = [your db value];
$retval->Email = [your db value];
return $retval;
}
Then in your code:
$thisUser = getVisitor($cookie_id);
echo $thisUser->FirstName;
Abd if you get even more into OOP you would actually define accessor methods instead of using public variables. In this case that may be overkill but is generally good OO practice.
G'luck,
Jack