Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="Display.php" method="post">
- <select name="searchValue">
- <option value="<?php $allColomns ?>">All</option>
- <option value="itemCode">Item Code</option>
- <option value="shopNumber">Shop Code</option>
- </select>
- <input type="text" name="search">
- <input type="submit">
- </form>
- $search = "%" . $_POST["search"] . "%";
- $searchValue = $_POST["searchValue"];
- //create the query
- $result = mysql_query("SELECT shopCode, itemNumber, itemDescription FROM sbh_itemsheet WHERE '$searchValue' LIKE '$search'");
- //return the array and loop through each row
- while ($row = mysql_fetch_array($result))
- {
- ?>
- <tr>
- <td><?php echo $row['id'];?></td>
- <td><?php echo $row['shopCode'];?></td>
- <td><?php echo $row['itemNumber'];?></td>
- <td><?php echo $row['itemDescription'];?></td>
- </tr>
- $allColomns
- $allcolomns = "shopCode, itemNumber, itemDescription";
- $result = mysql_query("select * from sbh_itemsheet WHERE <column_name> LIKE '%".$_POST[search]."%'");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement