Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Lines | 11 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
85 | View Code Duplication | 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 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.