Name: Anonymous 2008-03-22 21:21
HAI GUISE!!
I'm building basically a frontend for a specific database in php using postgres as rbdms, I'm new to php so I have no experience, so I ask you about how should I wire everything:
·The C way, functions for everything, no classes.
·A class for the database that takes querys, connects to the database and such, and then use that from the different files.
·Do it like this guy says: http://www.odi.ch/prog/design/php/guide.php and have a struct-like class (I'd go for an array instead though) and classes that handle the queries for every table, all sharing the same connection
·Mix the last two.
So far I'm inclined the the last point, but with a limited database object that limits itself to expose the database api and close the connection when it's destroyed, but maybe it's a bit too overkill??
I'm building basically a frontend for a specific database in php using postgres as rbdms, I'm new to php so I have no experience, so I ask you about how should I wire everything:
·The C way, functions for everything, no classes.
·A class for the database that takes querys, connects to the database and such, and then use that from the different files.
·Do it like this guy says: http://www.odi.ch/prog/design/php/guide.php and have a struct-like class (I'd go for an array instead though) and classes that handle the queries for every table, all sharing the same connection
·Mix the last two.
So far I'm inclined the the last point, but with a limited database object that limits itself to expose the database api and close the connection when it's destroyed, but maybe it's a bit too overkill??