I'm sure another super newbie question.
I have a page where I am populating a list from a mysql database table with a variable passed from a previous page.
code snippet:
// set varibles
$company = ($_POST['cds_user_company']);
$pass = ($_POST['cds_passtext']);
// Query the database
$query_plist = "SELECT * FROM cds_projects WHERE cds_company - $company ORDER BY cds_proj_name DESC";
$result_plist = mysql_query ($query_plist) or die ("query_plist on project_list.php failed to run"); // Run the query.
echo '<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="205" valign="top">';
echo '<br><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Select Project :</br></br>';
// create project listing loop
if ($result_plist) { // If it ran OK, display the records.
// Fetch and print all the records.
while ($row = mysql_fetch_array($result_plist, MYSQL_ASSOC)) {
echo '<font size="1" face="Verdana, Arial, Helvetica, sans-serif">
' . $row['cds_proj_name'] . '</font></br>';
}
mysql_free_result ($result_2); // Free up the resources.
This list generates the way it is suppose to.
I am wanting to make this list clickable so that if a person clicks on one of the values, it is passed onto another SELECT statement on the same page.
so if the above php generates something like below...
project 1
project 2
project 3
project 4
and the user clicks on line
project 4 there is a value assigned to the click taken from a mysql database table, from record row cds_proj_name (value may be ... project 4)
The value is passed onto a select statement like below in order to create another mysql list
$query_pentry = "SELECT * FROM cds_proj_logs WHERE cds_proj_name = $cds_proj_name
ORDER BY cds_log_created DESC";
$result_pentry = mysql_query ($query_pentry) or die ("query_pentry failed to run"); // Run the query.
My question is I am not sure how to handle this request - it is a function, some sort of hyperlink, or what?
Any suggestions would be greatly appreciated.
Thanks in advance
chris