November 2, 201214 yr Hi all im trying to make a website connect to a sql database on the server machine but it has the error of "undefined function sqlsrv_connect" but i solved this part but then it said "phrase error unexpected syntax" this is the cod can anyone help? //Connect to the database and test for a valid connection. //Return: public function Connect($Config) { $ConnectInfo = array ("Database" =>'Yourclinque', "UID" => 'sa', "PWD" => 'ss£$9009'); $servername="tcp:sample.database.windows.net,1433" $this->dbHandler = sqlsrv_connect ($servername, $ConnectInfo); if(!$this->dbHandler) { KillError("There were problems opening a database connection.", $this->LastSQLErrorDetails()); } } Edited November 3, 201214 yr by Renaissance-Design Code formatting
November 2, 201214 yr Your server doesn’t have the SQL server extension installed. http://uk1.php.net/manual/en/sqlsrv.installation.php
Create an account or sign in to comment