Guest User

Liudmila Mikhaleva

a guest
Nov 2nd, 2012
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <?php
  2. mysql_connect ("localhost", "shop_user","admin123");
  3. mysql_select_db ("shop");
  4.  
  5. $search = $_POST['brand'];
  6.  
  7. $sql = mysql_query("SELECT * FROM products WHERE brand like '%$search%' or productID like '%$search%' or description like '%$search%' or description like '%$search%'");
  8. echo "<center>";
  9. while ($result = mysql_fetch_array($sql)){
  10.  
  11. echo "<div><a href = index.php?view=item&id=".$result['brand'].">";
  12. echo "<img src ='userfiles/".$result['picture']."'>";echo "</br>";
  13. echo $result['brand']; echo "</br>";
  14. echo $result['colour']; echo "</br>";
  15. echo "$"; echo $result['price']; echo "</br>";
  16.  
  17. }
  18. echo "</center>";
  19.  
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment