Hi All,
I was trying to connect to access database and using php script want to retreive data.I don't know whether I can do this or not. Question is how to connect to access database???
I had done the following things to connect to ACcess:
1) First created datasourcename as "student" using ODBC datasouec(32bit) from control pannel.
2)Created a table in access.
3) here is the php script which I am trying to retreive data.
<title>
<b>This programme is dedicated to Sai Baba</b></title>
<body>
<? php
@ $db=mysql_pconnect("localhost","student","student");
if(!$db)
{
echo "Error:could not connect to database.please try again later";
exit;
}
mysql_select_db("db1");
$query = "select * from stu";
$result =mysql_query($query);
$num_results = mysql_num_rows($result);
echo "<p> number of books found: ".$num_results."</p>";
?>
</body>
When I try to run this getting the following error:
Parse error: parse error in c:\program files\apache group\apache\htdocs\data.php on line 6
Please help me.
Thanks in advance.
sankar.