This topic is locked

connect to MS-SQL error

10/8/2006 9:31:07 PM
PHPRunner General questions
O
ozakipw author

the error message is

Parse error: parse error, unexpected '{' in c:\appserv\www\aa\include\dbconnection.mssql.win.php on line 8


the line 8 code is

try {


the function code is

function db_connect()

{

global $host,$user,$pwd,$dbname,$mssql_dmy;

$connstr="PROVIDER=SQLOLEDB;SERVER=".$host.";UID=".$user.";PWD=".$pwd.";DATABASE=".$dbname;

try {

$conn = new COM("ADODB.Connection");

$conn->Open($connstr);

$rs=$conn->Execute("select convert(datetime,'2000-11-22',121)");

$str=$rs->Fields[0]->Value;

$y=strpos($str,"2000");

$m=strpos($str,"11");

$d=strpos($str,"22");

if($y<$m && $m<$d)

$mssql_dmy="ymd";

if($d<$m && $m<$y)

$mssql_dmy="dmy";

} catch(com_exception $e)

{

trigger_error($e->getMessage(),E_USER_ERROR);

}

return $conn;

}
Alexey admin 10/9/2006

Hi,
unfortunately PHPRunner-created pages require PHP 5 to run when working with MSSQL on Windows-based webserver.
In all other cases they require PHP 4.3.0 or later.
Consider upgrading PHP on your server.