Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I developed a PHP Website and backend is MS SQL 2012 and I used XAMPP as my development web server. If my website is intranet used it totally works such as connecting to database but when I hosted it to 1an1.com, it gives me this error:
SQL
Call to undefined function sqlsrv_connect() in dbconn.php on line 9.

Here's my database connection:
PHP
<?php

    $serverName='xxx.xxx.00.xx'; //<-- should I include PORT here?
    $connectionInfo=array(
                    'Database'=>'DBName',
                    'UID'=>'userName',
                    "PWD"=>'Password');

    $conn = sqlsrv_connect($serverName,$connectionInfo); //<-- line 9 here

    if($conn){
        //echo 'Connection Established!<br />';
    }else{
        //echo 'Connection Failed!<br />';
        die(print_r(sqlsrv_errors(),TRUE));
    }

?>

Actually, I'm confused what to use.. like,should I use IIS here or other procedures but for development, I used XAMPP to test my website.

Or is it possible to use XAMPP here? for connecting my web hosted php website and my ms sql database?

I'm new with this kind of stuff, so if you can provide me some step by step articles for this is much more appreciated.

Thanks in advance
Posted

1 solution

you cannot connect an online web application from local system database. if your system is a server than you can do this otherwise not.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900