Jump to content


Photo

need help connecting to sql server


  • Please log in to reply
1 reply to this topic

#1 alrave

alrave
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 27 May 2005 - 12:01 AM

im new to php and im trying to connect to sql server, im using the following code:

<?php
$sqlserver = 'localhost';
$sqluser = 'sa';
$sqlpass = '';
$connex = mssql_connect(&sqlserver, &sqluser, &sqlpass);
if ($connex)
{
echo 'im in';
}
?>

it gives me the following error
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in c:\inetpub\wwwroot\test\test1.php on line 15

line 15 would be :
$connex = mssql_connect(&sqlserver, &sqluser, &sqlpass);

any help would be appreciated


#2 StarBuck

StarBuck
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 01 June 2005 - 03:14 PM

surely u should put '$' instead of the '&'






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users