-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathBuy.php
41 lines (29 loc) · 1.05 KB
/
Buy.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
if(!isset($_SESSION)) { session_start(); }
class Buy
{
public $table;
public function __construct()
{
$this->table = "buy_requests";
date_default_timezone_set('Africa/Lagos');
}
public function postRequest($intern_id, $amount, $trade_limit=2, $bid_per_coin, $status="Open", $db)
{
$sql = "insert into ".$this->table." (intern_id, amount, trade_limit, bid_per_coin, status) values (:intern_id, :amount, :trade_limit, :bid_per_coin, :status)";
$stmt = $db->prepare($sql);
$stmt->bindParam(':intern_id', $intern_id);
$stmt->bindParam(':amount', $amount);
$stmt->bindParam(':trade_limit', $trade_limit);
$stmt->bindParam(':bid_per_coin', $bid_per_coin);
$stmt->bindParam(':status', $status);
if ($stmt->execute()) {
return true;
}
else {
return false;
//echo $db->error;
}
}
//member class ends here
}