Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. $results = $mysqli->query("SELECT * FROM products ORDER BY id desc");
  2. if ($results) {
  3.  
  4. //fetch results set as object and output HTML
  5. while($obj = $results->fetch_object())
  6. {
  7. echo '<div class="product">';
  8. echo '<form method="post" action="cart_update.php">';
  9. echo '<div class="product-thumb"><img src="img/'.$obj->product_img_name.'"></div>';
  10. echo '<div class="product-content"><h3>'.$obj->product_name.'</h3>';
  11. //echo '<div class="product-desc">'.$obj->product_desc.'</div>';
  12. echo '<div class="product-info">';
  13. echo 'Price '.$currency.$obj->price.' | ';
  14. echo 'Qty <input type="text" name="product_qty" value="1" size="3" />';
  15. echo '<button class="btn btn-warning btn-xs"">Add To Cart</button>';
  16. echo '</div></div>';
  17. echo '<input type="hidden" name="product_code" value="'.$obj->product_code.'" />';
  18. echo '<input type="hidden" name="type" value="add" />';
  19. echo '<input type="hidden" name="return_url" value="'.$current_url.'" />';
  20. echo '</form>';
  21. echo '</div>';
  22. }
  23.  
  24. }
  25.  
  26. .product {
  27. display:inline;
  28. }
  29.  
  30. .product * {
  31. display:inline;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement