Forum Moderators: coopster

Message Too Old, No Replies

How Can I convert a MySQL/PHP script to an ORACLE/PHP one?

I'm trying to convert some PHP scripts but I have some difficulties...

         

thewiz

10:19 am on Jun 23, 2004 (gmt 0)

10+ Year Member



At present, I'm trying to convert some PHP scripts which are based to MySQL database to something similar which should work with ORACLE...
The original scripts have a lot of library function like "mysql_num_fields, mysql_fetch_field, mysql_fetch_array, mysql_error, and so on..." and, to have a correct result with Oracle, I have to translate these code function to something which does the same thing with Oracle.
I know (and I'm trying to use them) that are available the "ORA..." and "OCI..." functions but I did a search about a conversion table from/to "mysql_" with no success...
Does anybody know where I could find one?

Thanks in advance

timster

12:48 pm on Jun 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello thewiz, and welcome to WebMasterWorld.

I'm not aware of a magic bullet for this, but you may want to look into PEAR DB, which will let you write code that is basically database independent.

[pear.php.net...]

bcolflesh

1:14 pm on Jun 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ADOdb is another good choice:

[adodb.sourceforge.net...]

thewiz

2:37 pm on Jun 23, 2004 (gmt 0)

10+ Year Member



Thanks for your answers.
I'll keep them for future needs... but the "problem" still remains.
I have to translate the scripts (there are many of them...) to aim at the complete porting of the application from MySQL to Oracle...

;-(

bcolflesh

2:42 pm on Jun 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You shouldn't have to "translate" many scripts - just one that contains your DB connection info - then include() it - that's the point of an abstraction layer.

jatar_k

5:38 pm on Jun 23, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Oracle 8 functions [ca.php.net]

These functions allow you to access Oracle9, Oracle8 and Oracle7 databases. It uses the Oracle Call Interface (OCI).