Good Evening everyone.
I work for a marquee firm and i am creating a php mysql components list for the assistance for loading equipment.
SO far, the user can input a marquee size (eg: 6mx3m) in a form and we search the database and output the items required for said marquee size.
This is the code
<h2>Components List</h2>
<?php
if (isset($_POST['frame'])){
$size = $_POST['first'].'x'.$_POST['second'];
echo " Components needed for a $size are;";
echo "<br />";
$result = mysql_query("SELECT * FROM frames WHERE size='$size'",$conn);
$row = mysql_fetch_array($result);
echo "Legs: ";
echo $row['legs'];
echo "<br />";
echo "Roof Beams: ";
echo $row['roof-beams'];
echo "<br />";
echo "Middle Legs: ";
echo $row['middlelegs'];
echo "<br />";
echo "Inner Purlins: ";
echo $row['purlins'];
echo "<br />";
echo "Outer Purlins: ";
echo $row['outer-purlins'];
echo "<br />";
echo "Fat Bars: ";
echo $row['fat-bars'];
echo "<br />";
echo "Top Bars: ";
echo $row['top-bars'];
echo "<br />";
echo "Bottom Bars: ";
echo $row['bottom-bars'];
echo "<br />";
echo "Spiggots: ";
echo $row['spiggots'];
echo "<br />";
echo "Base Plates: ";
echo $row['base-plates'];
echo "<br />";
echo "Chains: ";
echo $row['chains'];
echo "<br />";
}?>
<form action="<?php $_SERVER['PHP_SELF'];?>" method="post">
Frame Size<br />
<input type="text" name="first" width="2" /> x <input type="text" name="second" width="2" /><bR />
<input type="submit" name="frame" value="Get Components" />
</form>
My aim and problem is if the user has three or four marquees to load how would i implement the forms and how, if possible, could the whole lot be added together so the output remains how it i now with all the components added together!
eg if the user wants a 6x3m frame tent he would need 4 legs but if he also needed a 6x6m he would need a further 6 making the output 10. Sounds complicated but i'm sure it is quite possible i'm just not sure on how to go about it!
Any help, pointers are always appreciated.
Regards
Chris