Hello guys, i am new to PHP and finding it interesting difficult at the same time. I need to connect to an access database depending on the selected menus in the drop down box and printing the selected field in a table.
Here is my code
<?php
$ch1 = 'unchecked';
$ch2 = 'unchecked';
$ch3 = 'unchecked';
$ch4 = 'unchecked';
$ch5 = 'unchecked';
$myform = $_POST['myform'];
$bandwith = $_POST['bandwith'];
$webspace = $_POST['webspace'];
$payment =$_POST['payment'];
$dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq= E:\\wwwroot\php\hosting.mdb;Uid=;Pwd=;";
$conn=odbc_connect($dsn,'','');
if (!$conn )
{exit("Connection Failed: " . $conn);}
if ($webspace === '200 mb' && $bandwith === '3000 mb' $payment === '£22.90 per year' ){
$sql="SELECT * FROM data"}
$rs=odbc_exec($conn,$sql);
if (!$rs)
{exit("Error in SQL");}
echo "<table><tr>";
echo "<th>Features</th>";
echo "<th>Bronze</th></tr>";
while (odbc_fetch_row($rs))
{
$feat=odbc_result($rs,"Features");
$br=odbc_result($rs,"Bronze");
echo "<tr><td>$feat</td>";
echo "<td>$br</td></tr>";
}
odbc_close($conn);
echo "</table>";
?>