I have a mysql table test_equipment
with fields
Expand|Select|Wrap|Line Numbers
- Equipment_name varchar(100) NOT NULL,
- image_url varchar (300),
- Description varchar(1000) NOT Null,
my file name is view_test_equipment.php where i dump all the data from the test_equipment in html table.
the code is
Expand|Select|Wrap|Line Numbers
- <?php
- include('db_connect.php');
- ?>
- <form action="selected_test_equipment.php" method="post">
- <?php
- $result_orders = mysql_query("Select * from test_equipment")or
- die ("<font color = red> Query Error </font>".mysql_error);
- ?>
- <br>
- <center>Equipments availabe for testing</center>
- <br>
- <table width=80% border="1" cellspacing="1" cellpadding="1">
- <tr>
- <td>
- <font size="3"><b>Equipment Name</b></font>
- <td align = center>
- <font size="3"><b>image</b></font>
- <td width="" align = center>
- <font size="3"><b>Description</b></font>
- <td width="" align = center>
- <font size="3"><b>Select for Enquiry</b></font>
- <?php
- while ($row=mysql_fetch_array($result_orders))
- {
- $image = "../admin/images/Test_Equipment_images/".$row['image_url'];
- $img = $image;
- echo '<tr align = "left">';
- echo '<td>';
- echo $row["Equipment_name"];
- echo '</td>';
- echo '<td width = 60>';
- echo "<img src = '$img' width = 60 height = 60>";
- echo '</td>';
- echo '<td>';
- echo $row["Description"];
- echo '</td>';
- echo '<td>';
- echo '<input type="checkbox" name="Equipment_name[]" value= $row["Equipment_name"];>';
- echo '</td>';
- echo "</tr>";
- }
- echo '</table>';
- echo '<br>';
- mysql_free_result($result_orders);
- ?>
- </table>
- <center> <input type="submit" name="formSubmit" value="Submit">
Expand|Select|Wrap|Line Numbers
- ------------------------------------------------------
- Equipment Name|Image|Description |select for Enquiry |
- ------------------------------------------------------
- abc |img1 |asdfasfffas |Checkbox[](i select this)
- ---------------------------------------------------------
- xyz |img2 |8789798 |Checkbox[](idonotselect)
- -----------------------------------------------------------
- mno |image|oiop0980 |Checkbox[](i select this)
- ----------------------------------------------------------
- Submit button
i want the out put like this
Expand|Select|Wrap|Line Numbers
- You have selected the follwing Equipment for enquiry
- ------------------------------------------------------
- Equipment Name|Image|Description |select for Enquiry |
- ------------------------------------------------------
- abc |img1 |asdfasfffas |Checkbox[](i select this)
- ---------------------------------------------------------
- mno |image|oiop0980 |Checkbox[](i select this)
- ----------------------------------------------------------
- Woule you like to add more equipment then goback or process the enquiry