I need to validate username if it already exists in database.
I connect to database, validate.
Then other php code
Then again I need to validate email if it already exists in database.
Is it necessary to close connection after each query? mysqli_close($mysqli);
Or I can close one time at bottom of file when I know that latter would not be necessary to connect to database.
I mean for security reasons. If i close at bottom of file, are there exist some security problems?