Hi there.
Sorry to make a seperate post, but it is a seperate issue.
I have a page which starts off with a drop down list. This lists all customers that are stored in the Customers table and shows the cust_id. (Also, is it easy to show the cust_id as well as the name next to it?)
How do I code it so that when the user chooses a customer from the list, it will then display any records in the linked table (Timesheets) where the cust id is present.
So it will just show any timekeeping tasks that have been added against the chosen customer.
My code is as follows:
Code:
<h1>View Report</h1>
<p>Please choose a Customer ID from the drop down selection below, then press Submit to view a list of the tasks recorded against the select Customer.</p>
<?php
include 'config.php';
include 'opendb.php';
$res=mysql_query("SELECT * FROM customers order by cust_id") or die(mysql_error());
echo "<select name=myselect>";
while($row=mysql_fetch_assoc($res)) {
echo "<option value=$row[ID]>$row[cust_id]</a></option>";
}
echo "</select>";
include 'library/closedb.php';
?>
|