Quote:
Originally Posted by mindlessx
Hey I'm trying to setup a simple Website to create Accounts on my Server, but i can't connect to database.
Code:
$conn = new PDO("sqlsrv:server=$host;database=$acc;ConnectionPooling=0",$user,$pass);
$host="XXXXXXX\SQLEXPRESS"
But what if its not local? is there sth like "ip:XXXXXXX\SQLEXPRESS"
|
example
$host = "VALTYR-PC\SQLEXPRESS"; //SQL Host name
$user = "sa"; //SQL server username
$password = "YouTubeValtyr"; //SQL Server password
$dbs = array(
'ACC'=>"SRO_VT_ACCOUNT",
'SHARD'=>"SRO_VT_SHARD",
'LOG'=>"SRO_VT_SHARDLOG",
'WEB'=>"SRO_VT_VALTYR"); //Databases
Quote:
Originally Posted by mindlessx
But what if its not local? is there sth like "ip:XXXXXXX\SQLEXPRESS"
|
yes you can add via IP
open the port in SQL Server Configuration Manager
Click down SQL Server Network Configuration
click on Protocols for SQLEXPRESS and than Enable TCP/IP
after this double klick left and IP Addresses
Scroll down IPAll add in TCP Dynamic Port 1443
and done
Dont forget Restart SQL Server
and done
if you want to add via via sql host use your ip with port 1443 dont forget after your IP ,1443
example $host="127.0.0.1,1443"