This is a discussion on Access to different database types within the PHP Language forums, part of the PHP Programming Forums category; Hello, i need your help. I want to implement a php-script where I can access to different database types ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello,
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. Br, Scotty |
|
|||
|
scott.alfon@gmx.de schrieb:
> 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. 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 id INTEGER AUTO_INCREMENT 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. OLLi -- "What’s a little treason between old friends?" [Jack, Alias 508] |
|
|||
|
On Mar 26, 4:10 am, Oliver Grätz <oliver.gra...@gmx.de> wrote:
> scott.al...@gmx.de schrieb: > > > 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. > > 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 > > id INTEGER AUTO_INCREMENT > > 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. > > OLLi > > -- > "What's a little treason between old friends?" > [Jack, Alias 508] 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 language..in 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. >Furthermore I want to include an access >authorization which defines the write- or read-access of each user. A simple user manager could solve this. |