Re: Scrubbing MySQL Values and CSVtoArray()



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/
.



Relevant Pages

  • Re: OOD Question
    ... your work order task might have the work order ... instance of the derived classes will give the same information, ... > makes a database call. ... > If theres some change in base class I need to take care of these in all the> derived classes as well. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Using a Resource as a Class Property
    ... I'm aggragating the database object into a base class, ... other classes that "extend" that base class. ... But if you want to overwrite some methods to ...
    (comp.lang.php)
  • Re: Strongly typed DataSets: Relation between DataTable and TableAdapter
    ... Assuming I create a generic base base class like ... Public MustInherit Class MyBusinessObjectBaseClass(Of TDataRow As DataRow) ... update the database records in the base class. ... Is there a way to get the DataTable a TableAdapter 'belongs' to by code? ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Scalability VS Performance
    ... >> A common approach here is to have a separate data source for each ... > Above solves the problem of referencing the base class specific ... > database fields in the derived (WorkOrderTask) class and this is also one ...
    (microsoft.public.dotnet.framework.performance)
  • Re: Using a Resource as a Class Property
    ... Instantiating? ... I'm aggragating the database object into a base class, and then creating other classes that "extend" that base class. ...
    (comp.lang.php)

Loading