question about using sql server with php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • runway27
    Banned
    New Member
    • Sep 2007
    • 54

    question about using sql server with php

    i have a question about how to use sql database with php instead of using my sql database

    when i use my sql database the php code to connect to the my sql database is =

    Code:
    $conn = mysql_connect($hostname, $user, $password);
    
    if(!$conn)
    { 
    echo "Unable to connect to Database";
    }
    
    else
    {
    mysql_select_db($database, $conn);
    
    $query = mysql_query($selectquery);	
    
    mysql_close($conn); 
    }

    if i have to connect to a sql databse instead of my sql database as some companies use sql database, how can i change the php code to connect, run a query and close connection

    to the sql database.

    apart from changing the code to connect to sql database is there something else i need to do.

    php my admin is used to access the tables in mysql database, which tool should be used to access data in the tables for sql database.

    please advice.

    thanks
    Last edited by Markus; Oct 27 '08, 10:25 AM. Reason: added # tags
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Runway.

    To operate on an MS SQL Server database, you'll be using either PHP's mssql (http://php.net/mssql) or odbc methods (http://php.net/odbc).

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Runway27, we here at bytes.com pride ourselves on having a helpful, friendly and ever every-growing community. We ask of this community to follow a set of guidelines that are in place for your benefit. However, these guidelines are not always followed, and when they're not, we inform the user of the issue, point them to the guidelines and hope they see the light. Of course, this is not always how things turn out; the user may ignore all warnings and receive a temporary ban. All of the above is true in your situation.

      Now, after a temporary ban comes a permanent ban, but we're not quick to throw around the banhammer on bytes.com; we want to be as helpful and guiding as possible without having to remove offenders. Ergo, it has been decided, in our good nature, to give you a final chance. Make no mistake: if you fail to use code tags, double post, or post outside of the guidelines again, you will be issued with a permanent ban.

      I hope you will read the Posting Guidelines especially on 'how to ask a question'.

      Moderator.

      Comment

      Working...