Posted by Toby A Inkster on 08/17/07 10:38
Sanders Kaufman wrote:
> I have a database.php file that does *all* of the database work, and
> then a base class that does the business logic. But if I have to put
> the mysql-specific scrubbing function in the business logic base class -
> it defeats the purpose of putting ALL of the database work in database.php.
The solution is not to put the MySQL-scrubbing into the business logic
class, but to have the business logic class return an array (or,
even better: object) instead of a CSV string. Then the database class can
easily perform database-specific scrubbing mechanisms on the data before
inserting it into the database.
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 57 days, 14:16.]
Elvis
http://tobyinkster.co.uk/blog/2007/08/16/elvis/
[Back to original message]
|