You are here: does require belong inside a class? « PHP Programming Language « IT news, forums, messages
does require belong inside a class?

Posted by nephish on 08/17/06 02:56

hey there,
ok, i am starting with building my Customer custom php class.
now, one funciton that i want to write will populate the class
variables with values from the database. i have a function that makes
my connection for me. This is so i dont have the connection code in the
web_root folder .
so in most of my php pages i have something like
require('/var/common_php/db_connect.php');

then have $conn = make_db_connection();

ok, so now i have this class, the class is going to be the only class
of the php file that will be saved as the same name. Class Customer in
Customer.php. So, where do i put my connection function ?
inside the class? or just in the same file? or in the php page that
calls the class ?
what would be best ?
thanks

 

Navigation:

[Reply to this 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

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