SHOW:
|
|
- or go back to the newest paste.
1 | <?php | |
2 | - | session_start(); |
2 | + | |
3 | /*** ketik problem anda dibawah ini | |
4 | mengeluarkan sesuai controller | |
5 | - | masalah saya adalah bla-bla |
5 | + | |
6 | - | solusi yang di inginkan |
6 | + | |
7 | - | bla-bla bla |
7 | + | |
8 | class Db | |
9 | { | |
10 | private $dbSetup; | |
11 | private $conn; | |
12 | private $que; | |
13 | - | /*** |
13 | + | function __construct($param) |
14 | - | pesan error apa yang diterima |
14 | + | { |
15 | $this->dbSetup = $param; | |
16 | } | |
17 | ||
18 | function db() | |
19 | { | |
20 | $this->conn = new PDO($dsn, $user, $password); | |
21 | } | |
22 | ||
23 | function beginTransaction(){ | |
24 | $this->conn->beginTransaction(); | |
25 | } | |
26 | ||
27 | function countRegisteration($data) | |
28 | { | |
29 | $email = $data['email']; | |
30 | $que = $this->conn->prepare("select count(*) from table where email=?"); | |
31 | $que->bindValue(1, $email); | |
32 | ||
33 | $this->que = $que; | |
34 | } | |
35 | ||
36 | function st() | |
37 | { | |
38 | $this->que->execute(); | |
39 | } | |
40 | ||
41 | function fetchColumn() | |
42 | { | |
43 | return $this->que->fetchColumn(); | |
44 | } | |
45 | } | |
46 | ||
47 | ||
48 | /* end of file */ | |
49 |