Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <? php
- class Order {
- private $name, $price, $quantity;
- public __construct($iName, $iPrice, $iQty) {
- // You should sanitize these.
- $this->name = $iName;
- $this->price = $iPrice;
- $this->quantity = $iQty;
- require_once ('../mysqli_connect.php');
- // Preferable to pass this in through the constructor rather than rely on $_SESSION from within the object.
- $ui = $_SESSION['user_id'];
- //$q = "SELECT * FROM user WHERE user_id = $ui";
- $o = "SELECT * FROM order WHERE user_id = $ui";
- $r = mysqli_query ($dbc, $o); // Run the query.
- $row = mysqli_fetch_assoc($r);
- }
- public placeOrder() {
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement