MySQL to MSSQL

Discussion in 'Web Design and Development' started by Cabbit, Jan 7, 2010.

  1. Cabbit macrumors 68020

    Cabbit

    Joined:
    Jan 30, 2006
    Location:
    Scotland
    #1
    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?
     
  2. elppa macrumors 68040

    elppa

    Joined:
    Nov 26, 2003
    #2
    Try changing all your mysql_ calls to mssql_ first.

    They almost all have equivalents mapped.

    php mssql
     
  3. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #3
    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).
     
  4. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #4
    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.
     
  5. Cabbit thread starter macrumors 68020

    Cabbit

    Joined:
    Jan 30, 2006
    Location:
    Scotland
    #5
    Hey folks i got it transfered to that awful MsSQL without much issue.
    http://0904287.studentweb.abertay.ac.uk/eshop/ Finished assignment here, everything according to the module descriptor, no fancy MVC frameworks or clean URLs or validation just messy PHP and a MSSQL database.
     

Share This Page