Right on Thanks Everybody!!!!!!!!!!!
It is passing the id and not the table values. ex company name for for the next query.
dropdown is populated from mysql
You select a name and click submit
script does a query finds that company name in company_name table and displays it.
The script will grow from here, but I need to start somewhere.
query.php
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$dbname = 'webform';
@mysql_select_db($dbname) or die( "Unable to select database");
$query="SELECT id,company_name FROM webprojects";
$result = mysql_query ($query);
echo "<form name=form method=post action='data.php'>";
echo "<select name=\"company_name\">";
while($nt=mysql_fetch_assoc($result)){
echo "<option value=$nt[id]>$nt[company_name]</option>";
}
echo "</select>";// Closing of list box
echo "
<input type=submit value=submit name=button>
</form>";
?>
data.php
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$dbname = 'webform';
mysql_select_db($dbname) or die( "Unable to select database");
$company_name=$_POST['company_name'];
if(isset($_POST['button']))
{
echo "<tr> <th>Company Name ".$company_name. "</th></tr>";
$query = "SELECT 'company_name' FROM webprojects WHERE 'company_name'='" . $company_name ."'";
$result = mysql_query($query) or die(mysql_error());
echo "<table border='1'>";
echo "<tr> <th>Company Name</th></tr>";
while($row = mysql_fetch_assoc($result))
{
echo "<tr><td>";
echo $row['company_name'];
echo "</td></tr>";
}
echo "</table>";
}
else{
}
?>