Access to different database types

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


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-26-2007
scott.alfon@gmx.de
 
Posts: n/a
Default Access to different database types

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

Reply With Quote
  #2 (permalink)  
Old 03-26-2007
Oliver Grätz
 
Posts: n/a
Default Re: Access to different database types

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]
Reply With Quote
  #3 (permalink)  
Old 03-26-2007
ELINTPimp
 
Posts: n/a
Default Re: Access to different database types

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.

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:01 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0