Topic: OOP with database
Hallo Stefan,
Thanks for great tutorial. Finally someone who doesn’t bore you with only theory!
I’m a student and learning oop with php.
How we were taught is to begin with making the structure of you system and then make a table structure and so on….
I’ve made the a table structure and want to translate it into oop php and don’t know if I’m doing it right?
Here is an example:
Figure 1
How do you translate this into oop???
Something like this:
class customer{
//vars
$first_name;
$last_name;
$company;
$city;
$state;
$zip_code;
$phone;
$fax;
$email
//functions
function get_first_name(){
return $this->first_name;
}
}
And how do you combine everything together???
Can you please give me an example??
Thanks in advance
