Reply to RE: [PHP] Migration from MySQL to MS-SQL Server

Your name:

Reply:


Posted by "Thomas" on 12/09/05 14:17

Hi Behzad,

It's not as easy as simply replacing the names. I went through a cycle like
that myself. It is right to check your sql statements first (because 10 to
10 they will differ at some point).
Be also mindful that with mssql you don't have an _insert_id() function, you
would have create that first yourself, making a separate db call.

Another option is to use odbc_ instead of mssql. That way you are somewhat
independent of your db server (but it is more of a mission to convert).

Greatest pain I had was the connection to SQL Servers. We switched to odb_
functions for that reason (but then again, we might have been stupid :-)_

If you are rewriting the project, why don't you implement a DB abstract
layer, like PEAR:DB or adodb_lite? Will take you a while but will make your
code look so much better.

Cheers

Thomas

-----Original Message-----
From: AmirBehzad Eslami [mailto:behzad.eslami@gmail.com]
Sent: 09 December 2005 12:56 PM
To: php-general@lists.php.net
Subject: [PHP] Migration from MySQL to MS-SQL Server

Hi List,

I want to re-implement a PHP-driven package named ATutor (http://atutor.ca)
to work with MS-SQL Server.
Currently, it works with MySQL.

Unfortunately, authors of "ATutor" have not defined a class for database
connectivity.
In other words, they call each mysql functions directly in their code.
It seems that I must change every line of code to make ATutor work with
MS-SQL Server.

1) Is it suffice to replace every "mysql_FUNCTION" with "mssql__FUNCTION"
in the code? I realized that most of MSSQL functions are very similar to
MySQL functions, but their prefixes are different.
(I should kindly thank the PHP Development Team for this)

2) I have not worked with MS-SQL Server before. Is there anything else which
I should keep in mind?

Thank you in advance,
Behzad

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация