@@ 55-65 (lines=11) @@ | ||
52 | * |
|
53 | * @return 0 | 1 |
|
54 | */ |
|
55 | public function validateEmailInDb($email) |
|
56 | { |
|
57 | $query = "SELECT login_id FROM login WHERE email = '$email'"; |
|
58 | if ($result = $this->connect->query($query)) { |
|
59 | if ($result->num_rows > 0) { |
|
60 | return 1; |
|
61 | } |
|
62 | return 0; |
|
63 | } |
|
64 | } |
|
65 | ||
66 | /** |
|
67 | * For checking whether the credentials are empty or not |
|
68 | * |
|
@@ 73-82 (lines=10) @@ | ||
70 | * |
|
71 | * @return 0 | 1 |
|
72 | */ |
|
73 | public function validateUsernameInDb($username) |
|
74 | { |
|
75 | $query = "SELECT login_id FROM login WHERE username = '$username'"; |
|
76 | if ($result = $this->connect->query($query)) { |
|
77 | if ($result->num_rows > 0) { |
|
78 | return 1; |
|
79 | } |
|
80 | return 0; |
|
81 | } |
|
82 | } |
|
83 | } |
|
84 |