PDA

View Full Version : going from mysql to Microsoft SQL server


imported_joe
11-19-2002, 01:03 PM
Ok, I've got a php script in progress that I'm going to have to move from a linux/php/mysql server to a win2k/IIS/MS sql server box. How much editing am I going to have to do? will my sql queries and connections and such work? I'm not a genius at php, but not a TOTAL newbie, but, i didn't read the chapter on MSSQL :) so how much editing am I going to have to do? wasn't sure wether to put this here or in the php forums so here we are.

EscapeCharacter
11-19-2002, 07:10 PM
last i heard all the functions in php for db interaction are different for each db(which is kinda stupid imo). so youll probably have to change the functions, as far as the actual data it should be the same assuming all the tables and such you have in mysql are the same ini mssql.

skidooer
11-19-2002, 07:38 PM
MySQL does have a different SQL syntax so if you are using any MySQL dependant commands, beware! You'll also have to change all your functions as EscapeCharacter has mentioned unless you used one of the avaliable wrappers.

iDxMan
11-19-2002, 09:29 PM
Exactly [echoing the above]. If you used the mysql_* functions directly and need to update them to mssql_* anyways, its a fine time to use a DB abstraction wrapper.

I'd recommend at least looking at ADODB and PEAR.

http://php.weblogs.com/ADODB

and yes, be careful of the mysql-specific syntax traps like `LIMIT` . In ADO, you would use the SelectLimit() method so that its consistent.

-r