Sorry its taken so long to reply...
Cheers for the response. So just to double check this now, if i do...
PHP Code:
class Customer {
private $fName;
private $lName;
private $errorOccurred;
private $errorText;
function setLName($value = '') {
$this->lName = $value;
}
function
function readCustomer ($email = '') {
$sql ="SELECT * FROM customer WHERE email = '$email'";
$customer = new Customer();
if result then {
$customer->setLName($result['lName']);
//etc
} else {
//set flag same as setting lName
}
return $customer;
}
}
then to read it
PHP Code:
$customer = new Customer();
$customer->readCustomer('test@test.com');
if($customer->getErrorOccurred()) {
//error couldnt get user details from db
} else {
//great, get other customer details
echo $customer->getLName();
}
right? or wrong?
also could i do this?
PHP Code:
$customer->Customer::readCustomer('test@test.com');
or does that mean im doing things differently?
cheers for the help guys, i know im being stupid.
Bookmarks