My two drop down menus work ok, it’s just when I use the mysql_result() function the data I need from the database is not showing up
[php]
Equipment Database
<?php
$dept=$_GET['var1'];
$equip=$_POST['equip'];
if(!isset($_POST['submit'])) {
?>
Choose a Business Unit:
<?php
// ++++++++++++++LOAD DEPARTMENT DROPDOWN+++++++++
if($dept)
{
//Reload if a value for dept is not entered
print "" ;
print "$dept";
print "";
}else{
//Display forging and conventional option
print"" ;
print"";
print"Conventional";
print"Forging";
print"";
}
//Connect and check database.
$database="equipid";
mysql_connect("192.168.0.225");
mysql_select_db($database) or die( "Unable To Connect to SQL Database");
$result1=mysql_query("SELECT `Equip_ID` FROM `machine` WHERE `Department`='$dept'");
mysql_close();
print "
";
print "Choose the equipment to be viewed: ";
print "
";
print "";
while ($line = mysql_fetch_array($result1))
{
foreach ($line as $value)
{
print "$value";
}
print "";
?>
Click Submit to Post Your Entry:
<?php
//+++++++++++++Next Screen Showing Machine Information+++++++++++++++++++
}else{
$set=0;
$database=“equipid”;
mysql_connect(“192.168.0.225”);
mysql_select_db($database) or die( “Unable To Connect to SQL Database”);
$result2=mysql_query(“SELECT * FROM machine
WHERE Equip_ID
=’$equip’”);
$equipnum=mysql_result($result2,$set,“EquipFile #”);
$mfg=mysql_result($result2,$set,“Mfg”);
$mfgs=mysql_result($result2,$set,“Mfg Serial and/or Model #”);
mysql_close();
$output=mysql_fetch_array($result2);
echo $output;
?>
Equipment Number: <?php $equip ?> |
Mfg |
Equip File # |
Mfg Serial # and/or Model# |
<?php $mfg ?> |
<?php $equipnum ?> |
<?php $mfgs ?> |
<TABLE>
<tr WIDTH="1000" align="center" valign="middle">
<td WIDTH="400"></td>
<td>
<?php
}
?>
[/php]