+ Reply to Thread
Results 1 to 8 of 8

Thread: Mssql

  1. #1
    _jamz is offline x10Hosting Member _jamz is an unknown quantity at this point
    Join Date
    May 2007
    Posts
    3

    Mssql

    Hi friends, I'm currently running a MSSQL on my computer, and when i try to connect the database via a php script all i got is a blank white php page. Any idea what when wrong?... Or is there some additional component i need to install so that my computer can allow php access or smth?... :dunno:

    Code:
    <?php
    $dbhost = "theIPgoeshere"; $dbuser = "theusernamegoeshere"; $dbpass = "thepasswordgoeshere";
    @mssql_connect($dbhost,$dbuser,$dbpass)or die("error");
    @mssql_select_db("test2")or die("error");
    ?>

  2. #2
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: Mssql

    Remove the @'s so you can view the error occurring.
    Last edited by Bryon; 05-16-2007 at 07:54 PM.

  3. #3
    Micro is offline Retired staff (11-12-2008) Micro is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    West Midlands
    Posts
    1,301

    Re: Mssql

    Do you have PHP, Apache and MSSQL installed on your computer? If not, you will need to install Apache / PHP and its extensions (Google for LAMP).
    Micro

  4. #4
    _jamz is offline x10Hosting Member _jamz is an unknown quantity at this point
    Join Date
    May 2007
    Posts
    3

    Re: Mssql

    Quote Originally Posted by Micro View Post
    Do you have PHP, Apache and MSSQL installed on your computer? If not, you will need to install Apache / PHP and its extensions (Google for LAMP).
    I upload the php files on my x10 account.

    Quote Originally Posted by Bryon View Post
    Remove the @'s so you can view the error occurring.
    Here's what i got:
    Fatal error: Call to undefined function mssql_connect() in /home/jamzonli/public_html/test.php on line 3

    Any idea whats the problem?... :happysad:
    Last edited by _jamz; 05-17-2007 at 06:36 AM.

  5. #5
    t2t2t's Avatar
    t2t2t is offline x10 Elder t2t2t is an unknown quantity at this point
    Join Date
    Sep 2006
    Location
    Europe, Estonia
    Posts
    690

    Re: Mssql

    http://ee2.php.net/manual/en/ref.mss...l.requirements
    Requirements for Unix/Linux platforms.

    To use the MSSQL extension on Unix/Linux, you first need to build and install the FreeTDS library. Source code and installation instructions are available at the FreeTDS home page: » http://www.freetds.org/
    This post has been marked spam 52 times.


  6. #6
    S_W_A_T is offline x10 Sophmore S_W_A_T is an unknown quantity at this point
    Join Date
    Jul 2005
    Location
    Singapore
    Posts
    146

    Re: Mssql

    I got the same problem too... Does that mean we cant connect to MSSQL till x10 server has that extension installed on the server?...
    Last edited by S_W_A_T; 05-17-2007 at 05:40 PM.

  7. #7
    YamiKaitou's Avatar
    YamiKaitou is offline x10 Elder YamiKaitou is an unknown quantity at this point
    Join Date
    Oct 2006
    Posts
    636

    Re: Mssql

    x10 would need to install the MSSQL server on their servers, which I don't think they will do.

  8. #8
    Zenax's Avatar
    Zenax is offline Lord Of The Keys Zenax is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    The Brilliant United Kingdom
    Posts
    1,339

    Re: Mssql

    If I am right in saying MSSQL stands for Microsoft SQL or something like that??

    wouldnt it be easier to use the MySQL in cPanel, then perform the connection using this:

    PHP Code:
    // Enter the username here. Can be the main admin username or an account you assigned to it earlier.
    $sql[username] = "username here"

    // Enter your password here. Again can be done using admin password or the account you assigned to the db in the mysql manager in cPanel.
    $sql[password] = "password here";

    // Should be left at localhost. This should work.
    $sql[hostname] = "localhost";

    // Normally begins with your username. Example: zenax_website
    $sql[db_name] = "name of db here" 

    // Performs a connection to the SQL host, and if there is an error should display the error message
    $connection mysql_connect($sql[hostname], $sql[username], $sql[password]
    or die (
    "Sorry cannot connect to the SQL server");

    // Selects the database specified above. Uses the connection created earlier, if not shows error message
    $db_select mysql_select_db($sql[db_name], $connection)
    or die (
    "Sorry cannot connect to the DB on the SQL server. Please check your configuration settings"); 
    Last edited by Zenax; 05-18-2007 at 03:18 AM.
    Regards,
    Zenax

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers