Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 23rd, 2005, 01:37 AM
Brandon
Guest
 
Posts: n/a
Default PHP Postgre-MySql call redirector

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.
  #2  
Old November 23rd, 2005, 01:39 AM
Chris Travers
Guest
 
Posts: n/a
Default Re: PHP Postgre-MySql call redirector

Brandon wrote:
[color=blue]
>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.
>
>[/color]

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

[color=blue]
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster
>
>
>
>[/color]


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

  #3  
Old November 23rd, 2005, 01:39 AM
Robby Russell
Guest
 
Posts: n/a
Default Re: PHP Postgre-MySql call redirector

On Thu, 2004-08-12 at 01:09, Brandon wrote:[color=blue]
> 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[/color]

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
****************************************/


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQBBH7Ya0QaQZBaqXgwRAhWuAKDaUuxfydVH3DcVuUwr2W sdR5BiPgCeJ2PY
1M4qO7OGvuNYSL+jRerBLC4=
=0WjS
-----END PGP SIGNATURE-----

  #4  
Old November 23rd, 2005, 01:39 AM
Mike Mascari
Guest
 
Posts: n/a
Default Re: PHP Postgre-MySql call redirector

Chris Travers wrote:
[color=blue]
> Brandon wrote:
>[color=green]
>> Is there a call redirector available that redirects the calls to the
>> PHP MySql API (mysql_connect etc.) to a Postgre database?[/color][/color]

What the hell is Postgre? ;-)

Mike Mascari


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

  #5  
Old November 23rd, 2005, 01:39 AM
Peter Eisentraut
Guest
 
Posts: n/a
Default Re: PHP Postgre-MySql call redirector

Mike Mascari wrote:[color=blue]
> Chris Travers wrote:[color=green]
> > Brandon wrote:[color=darkred]
> >> Is there a call redirector available that redirects the calls to
> >> the PHP MySql API (mysql_connect etc.) to a Postgre database?[/color][/color]
>
> What the hell is Postgre? ;-)[/color]

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

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


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

 

Bookmarks

Thread Tools

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

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles