i may be wrong, but your use of the class to me seems pointless... the reuse aspect of your database connection could be done with a simple include... maybe your need is different from what i suspect, being a beginner myself... here is what i do, and maybe the list can tell me if it would be better or worse for you... in a seperate php file define your database info... <?php //begin database information $hostname = "localhost"; $db_user = "nerd_mysite"; $db_pass = "pepsi_is_good"; $database = "nerd__pepsi"; $l = @mysql_connect($hostname, $db_user, $db_pass); @mysql_select_db($database, $l); //end database information ?> and in the all of the files you would need this connection you would just include that file...and call the database with the variable $l. example: <? $nerdCheck = mysql_query("SELECT * FROM DrinkMorePepsi WHERE username = '$_POST[username]'", $l) ?> and this could easily be made into a function to allow for multiple databases, users passwords, ect.... if nothing else, at least tell me what you think about my way of doing this. ----- Original Message ----- From: "Robert Cummings" <robert@xxxxxxxxxxxxx> To: "Satyam" <Satyam@xxxxxxxxxxxxx> Cc: "Deckard" <ml@xxxxxxxxxxx>; <php-general@xxxxxxxxxxxxx> Sent: Thursday, October 05, 2006 2:16 AM Subject: Re: Help on objects > On Thu, 2006-10-05 at 07:04 +0200, Satyam wrote: > > I've seen you already had a good answer on the errors in the code so I won't > > go on that. As for OOP, the one design error you have is that you are > > asking for an action, not an object. You want to make SQL inserts, that is > > your purpose, and that is an action, which is solved by a statement, not by > > an object. There is no doer. Objects are what even your English teacher > > would call objects while describing a sentence. You are asking for a verb, > > you don't have a subject, you don't have an object. Of course you can wrap > > an action in a class, but that is bad design. Classes will usually have > > names representing nouns, methods will be verbs, properties adjectives, more > > or less, that's OOP for English teachers. > > Properties are very often nouns in addition to adjectives. For instance > a linked list class will undoubtedly have noun objects referring to the > current link, the next link, etc. > > Cheers, > Rob. > -- > .------------------------------------------------------------. > | InterJinn Application Framework - http://www.interjinn.com | > :------------------------------------------------------------: > | An application and templating framework for PHP. Boasting | > | a powerful, scalable system for accessing system services | > | such as forms, properties, sessions, and caches. InterJinn | > | also provides an extremely flexible architecture for | > | creating re-usable components quickly and easily. | > `------------------------------------------------------------' > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php