intazaar
asked on
MYSQL migration to MS sql 2005 using PHP
hi
im currenly using Mysql as my database manager, however i'd now like to use MSSQL 2005,
my question is, what steps do i need to take to make the change (in terms of updating the PHP code)
are there any differences in the query and connection strings?
are the full text search strings also the same ?
eg.
$sql = "
SELECT *,
MATCH (item,description) AGAINST ('$query') AS score
FROM items
WHERE MATCH (item,description) AGAINST ('$query')
ORDER BY score DESC
";
does any of this need to be changed?
thanks
im currenly using Mysql as my database manager, however i'd now like to use MSSQL 2005,
my question is, what steps do i need to take to make the change (in terms of updating the PHP code)
are there any differences in the query and connection strings?
are the full text search strings also the same ?
eg.
$sql = "
SELECT *,
MATCH (item,description) AGAINST ('$query') AS score
FROM items
WHERE MATCH (item,description) AGAINST ('$query')
ORDER BY score DESC
";
does any of this need to be changed?
thanks
ASKER
can you tell me which functions that 'dont behave the same way'?
and what would the code below be if it were converted to sql 2005
$sql = "
SELECT *,
MATCH (item,description) AGAINST ('$query') AS score
FROM items
WHERE MATCH (item,description) AGAINST ('$query')
ORDER BY score DESC
";
and what would the code below be if it were converted to sql 2005
$sql = "
SELECT *,
MATCH (item,description) AGAINST ('$query') AS score
FROM items
WHERE MATCH (item,description) AGAINST ('$query')
ORDER BY score DESC
";
I see you posted already a new question, please delete it, I will follow-up here, please be patient... just getting the infos to post...
you need either FREETEXT:
http://msdn2.microsoft.com/en-us/library/ms176078.aspx
or the CONTAINSTABLE:
http://msdn2.microsoft.com/en-us/library/ms189760.aspx
the links contain samples... if you really want to (have to) migrate, take the time to learn them...
in regards to functions that don't have the same name and/or behaviour:
mysql_error() -> mssql_ get_ last_ message() , but that function gives also warnings...
all mssql_xxx functions of php:
http://php.net/function.mssql-query
http://msdn2.microsoft.com/en-us/library/ms176078.aspx
or the CONTAINSTABLE:
http://msdn2.microsoft.com/en-us/library/ms189760.aspx
the links contain samples... if you really want to (have to) migrate, take the time to learn them...
in regards to functions that don't have the same name and/or behaviour:
mysql_error() -> mssql_ get_ last_ message() , but that function gives also warnings...
all mssql_xxx functions of php:
http://php.net/function.mssql-query
ASKER
ok... then...
the current code below is for MYSQL-PHP what would be the code to give me the saem result for MSSQL. NOTE: the 'score' syntax
$sql = "
SELECT *,
MATCH (item,description) AGAINST ('$query') AS score
FROM items
WHERE MATCH (item,description) AGAINST ('$query')
ORDER BY score DESC
";
the current code below is for MYSQL-PHP what would be the code to give me the saem result for MSSQL. NOTE: the 'score' syntax
$sql = "
SELECT *,
MATCH (item,description) AGAINST ('$query') AS score
FROM items
WHERE MATCH (item,description) AGAINST ('$query')
ORDER BY score DESC
";
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you
>are the full text search strings also the same ?
not at all:
http://msdn2.microsoft.com/en-us/library/ms142559.aspx