My pages run 100% ok on linux, but i need to use an SQL database and retain my PHP. This will probably run on a windows server. Someone give me the connection script for this.
My pages run 100% ok on linux, but i need to use MSSQL database and retain my PHP. This will probably run on a windows server. Someone give me the connection script for this.
My pages run 100% ok on linux, but i need to use MSSQL database and retain my PHP. This will probably run on a windows server. Someone give me the connection script for this.
If you have to connect to database in server you can use this script:
$connection=mssql_connect ($host, $username, $password);
But if you have to connect to the local host:
you should download Zip Package From this site(depends on php version):
http://www.php.net/downloads.php
and copy php_mssql.dll file to winnt\system32
and you should configure php.ini file by adding extension=php_mssql.dll
$connection=mssql_connect ($host, $username, $password);
But if you have to connect to the local host:
you should download Zip Package From this site(depends on php version):
http://www.php.net/downloads.php
and copy php_mssql.dll file to winnt\system32
and you should configure php.ini file by adding extension=php_mssql.dll
If you have to connect to database in server you can use this script:
$connection=mssql_connect ($host, $username, $password);
But if you have to connect to the local host:
you should download Zip Package From this site(depends on php version):
http://www.php.net/downloads.php
and copy php_mssql.dll file to winnt\system32
and you should configure php.ini file by adding extension=php_mssql.dll
$connection=mssql_connect ($host, $username, $password);
But if you have to connect to the local host:
you should download Zip Package From this site(depends on php version):
http://www.php.net/downloads.php
and copy php_mssql.dll file to winnt\system32
and you should configure php.ini file by adding extension=php_mssql.dll
here's the code:
mysql_connect("hostname",
"username","password");
the username and password are optional, i think.
use this to connect to the database, i assume you already know this:
mysql_select_db("dbname");
mysql_connect("hostname",
"username","password");
the username and password are optional, i think.
use this to connect to the database, i assume you already know this:
mysql_select_db("dbname");
what kind of SQL? if you meant MSSQL, here's how...
$conn=mssql_connect ($servername, $username, $password);
$conn=mssql_connect ($servername, $username, $password);
<?php
$conn = mysql_connect("localhost","USERNAME","PASSWORD");
mysql_select_db('DATABASE NAME') or die(mysql_error());
?>
sry are you talking about this ?
$conn = mysql_connect("localhost","USERNAME","PASSWORD");
mysql_select_db('DATABASE NAME') or die(mysql_error());
?>
sry are you talking about this ?
you might see the answer here:
www.w3schools.com
www.w3schools.com