Posted by nephish on 08/16/06 21:02
Hey there all.
i have been looking to simplify my huge website that i wrote while
learning php.
now its a spaghetti mess. So, i wanted to simplify it.
Now, i see the functionality that defining functions can give me. But
what is the magic behind classes?
i mean, the documentation i find. Most use the class Person as the
example. So how would having a person class help me. It seems that i am
writing more code than less because i am passing values thru a class
instead of directly updating a database.
for example: if i have a class Customer
$john = new Customer;
$john->name = 'john';
then the class updates the database with a new customer named john.
why not just send sql an insert to do this ?
just not getting it, but i know the advantages are there, could someone
help me.
thanks much
shawn
[Back to original message]
|