Hi, I'm having problems connecting to a Microsoft Access database. Im using PHP and ODBC but im not using a DNS.
The scripts below give no errors but I they only give me a blank white screen.
Any would be greatly appresiated. Please help.
Script 1
[php]
<HTML>
<HEAD>
<TITLE> Browse the race table </TITLE>
</HEAD>
<BODY>
<?php
$connstr = "DRIVER={Microsoft Access Driver(*.mdb)};DBQ=".realpath("Database/2PointB.mdb").";";
$conn=odbc_connect($connstr,",");
$stmt=odbc_tables($conn);
while( odbc_fetch_row($stmt))
{
$tabletype = odbc_result($stmt,4);
$tablename = odbc_result($stmt,3);
if($tabletype =="TABLE")
{
Print "<a HREF=browserace.php?table=" .$tablename.">" .$tablename ."</a>";
Print "<br>";
{
}
?>
</BODY>
</HTML>[/php]Script 2[php]
<HTML>
<HEAD>
<TITLE> Browse </TITLE>
</HEAD>
<BODY>
<?php
$table=$_GET["table"];
$sql="Select * from $table";
$connstr = "DRIVER={Microsoft Access Driver(*.mdb)};DBQ=".realpath("Database/2PointB.mdb").";";
$conn=odbc_connect($connstrr,",");
$stmt=odbc_exec($conn,$sql);
$nofileds=odbc_num_fields($stmt);
while( odbc_fetch_row($stmt))
{
$i=1;
while ($i<$nofields)
{
Print odbc_result($stmt,$i)."";
$i==;
}
Print "<br>";
}
?>
</BODY>
</HTML>[/php]