Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Cabbit

macrumors 68020
Original poster
Jan 30, 2006
2,128
1
Scotland
I have stumbled across a issue with a site i am submitting to uni tomorrow when i posted it to their server i found out that i have now mysql database(i had requested it and was given the login details but it ended up being a mssql database)

So by the scope of the project i have some database calls which are pretty much like
$sql = "SELECT * FROM `products` WHERE id = '".$id."'";
$result = mysql_query($sql) or die("Sorry there seems to be a problem with the database");
$dbObject = mysql_fetch_array($result);

So how would this translate to mssql is their a mysql to mssql guide somewhere?
 
Try changing all your mysql_ calls to mssql_ first.

They almost all have equivalents mapped.

php mssql
 
It is not the PHP that will be the problem I assume but the SQL. Although seeing as you have already done it for the worst database in existence MSSQL should be able to handle most of it (although there are some syntactic differences).
 
phpMyAdmin supports import of MSSQL from MySQL. So you'd do a standard export and then switch formats, select format of imported file to MSSQL and import. I've never tried it, seems easy enough. In worst case I'd export as CSV and import it back, another way to use phpMyAdmin effectively.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.