Object orientated mysql num_rows query in one line
Essentially, what I want to do is remove the extra $result line and have
it all in one IF statement. Is this possible in PHP using
object-orientated queries?
$result = $mysqli->query("SELECT id FROM users WHERE id ='".$user."'");
if ($result->num_rows == 1) {
// Continue...
}else{
// Does not exist, create...
}
No comments:
Post a Comment