<?php
$myServer = "localhost";
$myUser = $DB_User;
$myPass = $DB_Pass;
$myDB = "WebJournal"; // name of both the file and the DB
//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
//select a database to work with
$selected = mssql_select_db($myDB, $dbhandle)
or die("Couldn't open database $myDB");
//close the connection
mssql_close($dbhandle);
?>
- What are supposed to be username and password? A combination that we create here in this code, or are they from the database file? Because, I can't create a password, nor define a username for it on MSSQL Server Studio.
Is it possible that I can't connect due to restrictions on the MSSQL SS application? I tried to move the database from another folder but I only succeeded when I detached. And only could send it to the localhost when I put it offline.
As you can see, I'm a complete noob with PHP; I've read some tutorials, but I can't find anywhere the reason for this problem.
Thanks to anyone that can help me