Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- @author : Shubham Maurya,
- Email id : maurya.shubham5@gmail.com
- **/
- Hi all , Welcome to shubhammaurya.com , Today we are going to discuss ,
- How to Call Connect PHP to MSSQL database
- 1.Make a file in notepad and save it as dbconfig.php and paste the below code.
- <?php
- $server_name = "Your server name";
- $database_name = "Your database name";
- $DB_user = "Your Username";
- $DB_pass = "Your Password";
- try
- {
- $conn = new PDO("sqlsrv:Server=$server_name;Database=$database_name;ConnectionPooling=0",$DB_user, $DB_pass);
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- echo "done";
- }
- catch(PDOException $e)
- {
- $e->getMessage();
- }
- ?>
- STAY CONNECTED FOR MORE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement