Date: 04/05/00
- Next message: Björn Schotte: "Re: [PHPLIB] simple PHPLIB FAQ available"
- Previous message: Alexander Aulbach: "Re: [PHPLIB] Re: User data storage - $user vs. tablefields"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, 5 Apr 2000, Rasmus Lerdorf wrote:
}> Database calls are very much database-dependent, changing database
}> used might be a lot of pain..
}
}I really hate this point. How often do you change databases in a
}project? And, even if you do 90% of your work will be related to porting
}your schemas, stored procedures, triggers, etc. Stuff that a database
}abstraction layer won't help you with at all. However, we are adding a
}database abstraction layer in PHP 4 so this silly argument will go away.
I fully agree and will add some notes:
PHPLIB has already a DB-abstraction-layer as said by Rasmus (DB_Sql) and
also (in the newest version) an extending class (Query) which can generate
nearly DB *and* full table indepentend Queries out of PHP-arrays, because
it is a _fact_, that you change the table-definition of your project _much
more often_ than the database. Just an example:
WITH PHP:
mysql_query("insert into bla (a,b,c,d) values (2000305,2,3,'4')");
WITH PHPLIB:
$db->query($db->insert_clause("bla",ARRAY(a=>20000305,b=>2,c=>3,d=>4,x=>99));
There is no matter about the order, no matter about the type of the values
and no matter if you have defined all values or too much (see element
x=>99), insert_clause() will create _the same_ query as above.
Changing field 'a' to type 'date' needs you to to change all your queries
within PHP, but with Query you don't care about this. It dosn't bother you.
All programs will work correct.
This is perfectly useable for bigger applications, where speed is not the
top design aim, but correctness.
--SSilk - Alexander Aulbach - Herbipolis/Frankonia Minoris - (0931)22032
- PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>. To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in the body, not the subject, of your message.
- Next message: Björn Schotte: "Re: [PHPLIB] simple PHPLIB FAQ available"
- Previous message: Alexander Aulbach: "Re: [PHPLIB] Re: User data storage - $user vs. tablefields"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

