@@ 66-77 (lines=12) @@ | ||
63 | * |
|
64 | * @return integer 0|1 |
|
65 | */ |
|
66 | public function validateEmailInDb($email) |
|
67 | { |
|
68 | $query = "SELECT login_id FROM login WHERE email = '$email'"; |
|
69 | if ($result = $this->connect->query($query)) { |
|
70 | if ($result->num_rows > 0) { |
|
71 | return 1; |
|
72 | } else { |
|
73 | return 0; |
|
74 | } |
|
75 | } |
|
76 | } |
|
77 | ||
78 | /** |
|
79 | * Validating Username in Database. |
|
80 | * |
|
@@ 85-95 (lines=11) @@ | ||
82 | * |
|
83 | * @return integer 0|1 |
|
84 | */ |
|
85 | function validateUsernameInDb($username) |
|
86 | { |
|
87 | $query = "SELECT login_id FROM login WHERE username = '$username'"; |
|
88 | if ($result = $this->connect->query($query)) { |
|
89 | if ($result->num_rows > 0) { |
|
90 | return 1; |
|
91 | } else { |
|
92 | return 0; |
|
93 | } |
|
94 | } |
|
95 | } |
|
96 | } |
|
97 |