Here is the code that I got to pull two separte lists from a SQL DataBase. More explination below.
<?php
// open the connection
$conn = mysql_connect("*******", "*******", "***********");
// pick the database to use
mysql_select_db("exelon",$conn);
// create the SQL statement
$sql = "SELECT DISTINCT Site FROM Dresden";
// execute the SQL statement
$result = mysql_query($sql, $conn) or die(mysql_error());
//go through each row in the result set and display data
$options="";
while ($row=mysql_fetch_array($result))
{
$title=$row["Site"];
$options.="<option VALUE=\"$id\">".$title.'</option>';
}
?>
<body>
<form action="select.php" method="get">
<SELECT NAME=id>
<OPTION VALUE=0>Please choose Site
<?=$options?>
</SELECT>
</form>
</body>
<?php
// create the SQL statement
$sql = "SELECT * FROM Dresden";
// execute the SQL statement
$result = mysql_query($sql, $conn) or die(mysql_error());
//go through each row in the result set and display data
$options="";
while ($row=mysql_fetch_array($result))
{
$title=$row["EPN"];
$options.="<option VALUE=\"$id\">".$title.'</option>';
}
?>
<body>
<form action="select.php" method="get">
<SELECT NAME=id>
<OPTION VALUE=0>Please choose EPN
<?=$options?>
</SELECT>
<br />
<br />
<input type="Submit">
</form>
I have no select.php (AS LISTED ABOVE), this is code from before.
What i am looking for is Once I get the drop down menu Site selected to DRE and EPN i.e. 2-0202-51A (from drop down) I want to dispaly all the info in that row. Just for this "select Site and EPN" I can do this for all, but there are two many records.
Example of what I would like the output to be. (Or something around it.)
######################################################
EPN: 2-0202-51A
Component: MG Oil Cooler - 2A
Comments:
Tube_Size:5/8" x .049"
Tube_Material:Admiralty Brass
Tube_Material_Specifications:
Tube_Length:12'
Tube_Type:Straight's
Num_of_Openings:
Num_of_Tubes:498
ASME_Std_SN:Z-16745
Wear_Scar_Std_SN:N/A
Pitting__Std_SN_SN:CC-1047-IP
Thinning_Std_SN:Z-16749
Reference_Std_SN:Z-16743
Exam_Frequencies:26, 15, 7.5
Primary_Test_Probe:490 ESH/LF
Primary_Fill:0.86
#################################################################
Code for all the info output.
<?php
// open the connection
$conn = mysql_connect("********", "***********", "*************");
// pick the database to use
mysql_select_db("exelon");
$result = mysql_query("SELECT * FROM Dresden ");
mysql_query($query);
while ($row = mysql_fetch_array($result))
print "Site: $row[Site]
\n\n<br>EPN: $row[EPN]
\n<br>Component: $row[Component]
\n<br> Comments:$row[Comments]
\n<br> Tube_Size:$row[Tube_Size]
\n<br>Tube_Material:$row[Tube_Material]
\n<br>Tube_Material_Specifications:$row[Tube_Material_Specifications]
\n<br> Tube_Length:$row[Tube_Length]
\n<br> Tube_Type:$row[Tube_Type]
\n<br>Num_of_Openings:$row[Num_of_Openings]
\n<br>Num_of_Tubes:$row[Num_of_Tubes]
\n<br>ASME_Std_SN:$row[ASME_Std_SN]
\n<br>Wear_Scar_Std_SN:$row[Wear_Scar_Std_SN]
\n<br>Pitting__Std_SN_SN:$row[Pitting__Std_SN]
\n<br>Thinning_Std_SN:$row[Thinning_Std_SN]
\n<br>Reference_Std_SN:$row[Reference_Std_SN]
\n<br>Exam_Frequencies:$row[Exam_Frequencies]
\n<br>Primary_Test_Probe:$row[Primary_Test_Probe]
\n<br>Primary_Fill:$row[Primary_Fill]
\n<br>\n<br>";
?>
link to code TOP CODE = http://ironbelly.com/index2.php
BOTTOM CODE = http://ironbelly.com/test2/69.php
Thanks jason
Happy Holidays