I have a server that has advantage database server installed on it. Date is stored in this database that I would like to access via PHP. I an fairly new to PHP but kinda now my way around. I have googled this and found few examples. I do have the Advantage ODBC connection setup but I am unable to connect to the database for some reason. This is the current code that I have.
Now before you mention it there is no username or password assiciated with this database. I have checked.
[php]
<?php
$conn=odbc_conn ect('ads','','' );
if (!$conn)
{exit("Connecti on Failed: " . $conn);}
$sql="SELECT * FROM clmaster";
$rs=odbc_exec($ conn,$sql);
if (!$rs)
{exit("Error in SQL");}
echo "<table><tr >";
echo "<th>Companynam e</th>";
echo "<th>Contactnam e</th></tr>";
while (odbc_fetch_row ($rs))
{
$compname=odbc_ result($rs,"Com panyName");
$conname=odbc_r esult($rs,"Cont actName");
echo "<tr><td>$compn ame</td>";
echo "<td>$conna me</td></tr>";
}
odbc_close($con n);
echo "</table>";
?>
[/php]
Now before you mention it there is no username or password assiciated with this database. I have checked.
[php]
<?php
$conn=odbc_conn ect('ads','','' );
if (!$conn)
{exit("Connecti on Failed: " . $conn);}
$sql="SELECT * FROM clmaster";
$rs=odbc_exec($ conn,$sql);
if (!$rs)
{exit("Error in SQL");}
echo "<table><tr >";
echo "<th>Companynam e</th>";
echo "<th>Contactnam e</th></tr>";
while (odbc_fetch_row ($rs))
{
$compname=odbc_ result($rs,"Com panyName");
$conname=odbc_r esult($rs,"Cont actName");
echo "<tr><td>$compn ame</td>";
echo "<td>$conna me</td></tr>";
}
odbc_close($con n);
echo "</table>";
?>
[/php]
Comment