To make a connection with a mySql database :
- Use wamp server, to download it click here. Install it.
- Start it, left click on the icon in the task bar ( I say left click
)
- PHP > PHP Extensions > select php_mssql
- In your php page or classe use this code :// sqlServer connection
$login_sqlServer=USER; // your connection user
$pwd_sqlServer=PWD’; // password connection user
$chaine_connexion_sqlServer = IP_SERVER; // Name or IP of the databasse server
$bd_sqlServer=DB_NAME; // Database name
$con_sqlServer = mssql_connect($chaine_connexion_sqlServer, $login_sqlServer, $pwd_sqlServer) or die(“Impossible to make connection with SQL Server “);
$selected = mssql_select_db($bd_sqlServer, $con_sqlServer) or die(“Impossible to make connection with SQL Server “);
- Congratulation… You made a connection with your sqlServer database by using php.
See also :
- How to make your first php page?
- How to send and receive parameters in PHP?
- How to make a connection with a mySql database by using PHP?