473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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.
Nov 23 '05 #1
4 1907
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

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

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

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

Nov 23 '05 #2
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 | ro***@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-----

Nov 23 '05 #3
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
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #4
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/
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Eino Mäkitalo | last post by:
I had Visual C++ 6.0, so I compiled those libpq.dll and psycopg.pyd. if there are anyone to play with Windows, Python 2.3 and Postgre-8.0.0-beta4 for windows like me. You cat get those from:...
2
by: Mike Mascari | last post by:
Apparently the Postgres lineage is sufficiently obfuscated to cause people to think that the correct pronunciation/shorthand of PostgreSQL is 'Postgre' and not 'Postgres'. Note the last line in the...
2
by: Jason Tesser | last post by:
I am looking into using PostgreSQL on the backend here. I work for a Bible College. We are putting together a new software package. The database would be on a LInux box but our domain is M$ so we...
0
by: COXJ94 | last post by:
I have these postgre dbs, and I know nothing about them. I do know that I need to migrate them to db2. I've done someresearch and I think pg_dump with extract the ddls from postgre much like...
1
by: Pradeep83 | last post by:
Hi Everybody Can anybody help me where i can open source for postgre sql that is compatiable for Soalris 10 OS.and how to install the same after downloading , As I am new to this Database...
4
by: =?iso-8859-1?B?RulybmFz?= | last post by:
Hello all, I'm starting a new project and my boss asked me about "C# + Postgre"... I told him that i will look for some information.. Is there something that I should know, like some bug or...
1
by: nilart | last post by:
Hi, I have an installer application (Installshield) which installs postgre DB programmatically on windows: I have a requirement where postgre DB is expected work after upgrading OS from windows XP...
0
by: Miraj Godha | last post by:
Hi , I want to send array from java program to postgre. For oracle we can achieve it by using: ArrayDescriptor desc = ArrayDescriptor.createDescriptor("TYPE", conn); ARRAY newArray = new...
5
by: prajiv | last post by:
Hi, Pls guide me in synchronizing data from PostGre to Cache. i.e if we update in one database the other database must automatically get updated.I dont want to use the Tool ,I need the code for it...
4
by: lion cave | last post by:
Hi, I have a problem regarding on making function in postgre. I am newbie for this. My problem is that i want to make a function in postgre that accepts the name of the table. In the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.