Exemplo n.º 1
0
 function __construct($orderID = -1, $proID = -1)
 {
     if (self::$conn == Null) {
         self::$conn = mysqli_connect('localhost', 'root', 'iti', 'eShop');
     }
     if ($orderID != -1 && $proID != -1) {
         $query = "select * from orderItems where oID={$orderID} and pID={$proID} limit 1";
         $result = mysqli_query(self::$conn, $query);
         $orderItem = mysqli_fetch_assoc($result);
         $this->oID = $orderItem['oID'];
         $this->pID = $orderItem['pID'];
     }
 }