Ok I have a site that's already in PHP/MySQL...
I want to change over to MSSQL...
so say I have something like: mysql_query("Select * FROM online")
can't I just change it to: mssql_query("Select * FROM online")
so that it can work with MSSQL server?
I think that MySQL and MSSQL are very similar, at least, that's what I've been told. Might want to take a quick read through the manual on [man]MSSQL[/man] though.
Yes, that select will definitely work with MSSQL like many other, however there are some operators missing in MSSQL (like INTERSECT or MINUS); but there are some operators defined also in addition. So I dont' think that wou have to change much code.
awwww man... while changing my code... I noticed that MsSQL doesn't have the "LIMIT" feature like MySQL has.
I found out that you can use "TOP" to limit the number of records.
but I can't split my records up on different pages with mssql... 🙁.... like the "LIMIT 20,20" feature in MySQL.
Two ways to accomplish this in MSSQL:
Look at this link.
Add "rowID" to each row. Then add this type of WHERE clause:
WHERE rowID >= 20 AND rowID <= 40
or something similar.
Thanks for the link...
But another question..
I actually found out how to do the paging.. but now.. I find that MSSQL doesn't like the "LIMIT 0,20" like MySQL does.
Meaning.. I can't use "TOP 0"...
I can I use a zero with this method?
'LIMIT 0,20' means "Start at row 0 and count up 20 rows, then stop."
This is also the same thing as "Take the first 20 rows", which can be achieved using "TOP 20".