Access to different database types

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

i need your help.

I want to implement a php-script where I can access to different
database types as PostSQL, MySQL etc.
Is that possible? Furthermore I want to include an access
authorization which defines the write- or read-access of each user.

I hope this group could help me....I am looking for good ideas.

Thx for your help.


Re: Access to different database types schrieb:
Quoted text here. Click to load it

Yes it is possible and has already been solved a couple of times. Don't
waste time on reimplementing this but reside to using one of the
existing solutions like AdoDb or PEAR_DB. Using PDO already makes it
possible to access different DBMS but you have to write your SQL so that
it is accepted by all the DBMS you plan on using. For example, the code


will only work in a CREATE when using MySQL since most other DBMS have
another way of declaring auto-incrementing identifier columns.

Furthermore, you might want to use some ORM solution like Propel or one
of the solutions in the different frameworks depending on the nature of
your projects.


"What’s a little treason between old friends?"
[Jack, Alias 508]

Re: Access to different database types

Quoted text here. Click to load it

Agreed, PDO does have some good cross-database functionality, but, as
stated in it's name, PDO is not really designed to do this.  PDO
stands for PHP Data Objects and is designed to give a consistent
interface with databases, so you don't have to learn database-specific
PHP other words, it gives a "data-access" abstraction
layer.  What you're looking for is a database abstraction layer, which
really isn't too difficult to understand or implement.

Quoted text here. Click to load it

A simple user manager could solve this.

Site Timeline