Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <? php
  2. class Order {
  3. private $name, $price, $quantity;
  4. public __construct($iName, $iPrice, $iQty) {
  5. // You should sanitize these.
  6. $this->name = $iName;
  7. $this->price = $iPrice;
  8. $this->quantity = $iQty;
  9.  
  10. require_once ('../mysqli_connect.php');
  11.  
  12. // Preferable to pass this in through the constructor rather than rely on $_SESSION from within the object.
  13. $ui = $_SESSION['user_id'];
  14.  
  15. //$q = "SELECT * FROM user WHERE user_id = $ui";
  16. $o = "SELECT * FROM order WHERE user_id = $ui";    
  17. $r = mysqli_query ($dbc, $o); // Run the query.
  18. $row = mysqli_fetch_assoc($r);
  19. }
  20.  
  21. public placeOrder() {
  22.  
  23.  
  24. }
  25. }
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement