noob help!
Posted: Sun Mar 29, 2009 5:53 pm
hey guys new here dont know where to post this but here we go.
im trying to make a basic website linked to an access database. the website is a basic hosting website where the database stores one simple table that has five rows. first being the features, second the gold pack, then silver etc etc.
I have managed to link it so that it shows the table im after however how can i add either a drop down menu or search bar where the user can type in a particular amount of disk space they want and it produces the correct row.
heres the current code to link the database. as its on an apache server.
i have tried to find a good tutorial or sample but cant find one anywhere. any help would be greatly appreciated.
im trying to make a basic website linked to an access database. the website is a basic hosting website where the database stores one simple table that has five rows. first being the features, second the gold pack, then silver etc etc.
I have managed to link it so that it shows the table im after however how can i add either a drop down menu or search bar where the user can type in a particular amount of disk space they want and it produces the correct row.
heres the current code to link the database. as its on an apache server.
Code: Select all
<?php
$dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=E:\\wwwroot\packages.mdb;Uid=;Pwd=;";
$conn=odbc_connect($dsn,'','');
if (!$conn)
{exit("Connection Failed: " . $conn);}
$sql="SELECT * FROM hosting";
$rs=odbc_exec($conn,$sql);
if (!$rs)
{exit("Error in SQL");}
echo "<table border=1><tr>";
echo "<th> Features/Products </th>";
echo "<th> Bronze </th>";
echo "<th> Silver </th>";
echo "<th> Gold </th>";
echo "<th> Platinum </th>";
echo "</tr>";
while (odbc_fetch_row($rs))
{
$f1=odbc_result
($rs,"Features/Products");
$f2=odbc_result($rs,"Bronze");
$f3=odbc_result($rs,"Silver");
$f4=odbc_result($rs,"Gold");
$f5=odbc_result($rs,"Platinum");
echo "<tr>";
echo "<td>$f1</td>";
echo "<td>$f2</td>";
echo "<td>$f3</td>";
echo "<td>$f4</td>";
echo "<td>$f5</td>";
echo "</tr>";
}
odbc_close($conn);
echo "</table>";
?>
<br>
<br>
</p>