PHP adodb - what is wrong
Posted: Thu Nov 01, 2007 12:48 pm
hey,
i am trying to make a connection to a MS access database using adodb with the following code:
I get the following error message:
Parse error: syntax error, unexpected '{' in test.php on line 8
Thanks for the forthcoming help
i am trying to make a connection to a MS access database using adodb with the following code:
Code: Select all
$conn = new COM("ADODB.Connection");
try
{
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=".realpath("bla.mdb").";");
$rs = new COM("ADODB.Recordset");
$rs->Open("SELECT us, ps FROM users", $conn, 0, 1);
while(!$rs->EOF)
{
if(($usrname == $rs->Fields('us')->value) && ($pwd == $rs->Fields('ps')->value))
{
$rs->Close();
$conn->Close();
$rs = null;
$conn = null;
header('Location: test.php');
exit();
}
$rs->MoveNext();
}
$rs->Close();
$conn->Close();
$rs = null;
$conn = null;
header('Location: index.php');
exit();
}
catch( Exception $exception )
{
die("database error");
}Parse error: syntax error, unexpected '{' in test.php on line 8
Thanks for the forthcoming help