I'm attempting to connect to a MS SQL Server with:
<?
\\ ------------ mssql connection test file --------------------
$db_variables = substr($PATH_TRANSLATED,0,strrpos($PATH_TRANSLATED,"\"))."\includes\config.php";
include("$db_variables");
$db_handle = mssql_connect($server,$user,$password) or die("Couldn't connect to SQL Server on $server");
?>
My file, config.php, sits in a directory 'includes' which is on the same directory level as directory 'wwwroot' in C:\inetpub on an XP Pro box, and contains the login variables. Currently, I have the error: "Warning: Unexpected character in input: '\' (ASCII=92) state=1 in C:\Inetpub\wwwroot\dbtest.php on line 5".
Where am I going wrong please? I've already tried forward-slashes instead, but this did not help me.
include path issue
Moderator: General Moderators
Re: include path issue
Use double slashes.
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Re: include path issue
and by slashes, he means forward slashes:
Code: Select all
// this is a commentRe: include path issue
Thanks guys.
After much research, I also discovered that MS SQL Server 2005 ships with an old dll (ntwdb.dll). I updated that and can now connect and begin work at long last.
After much research, I also discovered that MS SQL Server 2005 ships with an old dll (ntwdb.dll). I updated that and can now connect and begin work at long last.