Reply to Re: not getting OO

Your name:

Reply:


Posted by Rik on 08/16/06 22:20

nephish wrote:
> 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 ?

Because you'll have to take care of connecting, updating, reporting errors
etc. That's the job of another class/object.

Grtz,
--
Rik Wasmus

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация