PHP Postgre-MySql call redirector

Started by Nonameover 21 years ago5 messagesgeneral
Jump to latest
#1Noname
brami@gmx.ch

Is there a call redirector available that redirects the calls to the
PHP MySql API (mysql_connect etc.) to a Postgre database? This would
be very usefull since a lot of PHP Scripts are coded for MySQL. I
think for most PHP scripts this would work out since the SQL syntax
from PostgreSQL and MySQL are very similar.

#2Chris Travers
chris@travelamericas.com
In reply to: Noname (#1)
Re: PHP Postgre-MySql call redirector

Brandon wrote:

Is there a call redirector available that redirects the calls to the
PHP MySql API (mysql_connect etc.) to a Postgre database? This would
be very usefull since a lot of PHP Scripts are coded for MySQL. I
think for most PHP scripts this would work out since the SQL syntax
from PostgreSQL and MySQL are very similar.

Hi Brandon;

I am not aware of any such module. It could be written but would not
likely be portable as there is no way I know of to redefine an existing
function. I.e. for a call redirector to work, the MySQL extensions
could not be loaded. This was current as of PHP4.

My response was to write an API which was similar to that used by MySQL
and use their syntax and record set handling rules, so that you could
run the script though a sed script to replace one set of API names with
another. Timestamp handling is still a problem though since MySQL
varies from the standard here.

Best Wishes,
Chris travers
Metatron Technology Consulting

Show quoted text

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

#3Robby Russell
robby@planetargon.com
In reply to: Noname (#1)
Re: PHP Postgre-MySql call redirector

On Thu, 2004-08-12 at 01:09, Brandon wrote:

Is there a call redirector available that redirects the calls to the
PHP MySql API (mysql_connect etc.) to a Postgre database? This would
be very usefull since a lot of PHP Scripts are coded for MySQL. I
think for most PHP scripts this would work out since the SQL syntax
from PostgreSQL and MySQL are very similar.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

You could remove the mysql libs and add create functions for this.

example

function mysql_connect($x)
{
pg_connect($x);
}

However, I would look into PEAR DB.

-Robby

--
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON | www.planetargon.com
* Portland, OR | robby@planetargon.com
* 503.351.4730 | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
****************************************/

#4Mike Mascari
mascarm@mascari.com
In reply to: Chris Travers (#2)
Re: PHP Postgre-MySql call redirector

Chris Travers wrote:

Brandon wrote:

Is there a call redirector available that redirects the calls to the
PHP MySql API (mysql_connect etc.) to a Postgre database?

What the hell is Postgre? ;-)

Mike Mascari

#5Peter Eisentraut
peter_e@gmx.net
In reply to: Mike Mascari (#4)
Re: PHP Postgre-MySql call redirector

Mike Mascari wrote:

Chris Travers wrote:

Brandon wrote:

Is there a call redirector available that redirects the calls to
the PHP MySql API (mysql_connect etc.) to a Postgre database?

What the hell is Postgre? ;-)

It's something like My, Server, and ite, only better.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/