Wether you use the object oriented style:
$handle = @mysqli_connect( "127.0.0.1", "root", "root" ) or die( "Cannot connect to the database!" );
$handle->mysqli_select_db( "phpherexamen" ) or die( "Connected to the database, but there's nothing here!" );
or the procedural style:
$handle = @mysqli_connect( "127.0.0.1", "root", "root" ) or die( "Cannot connect to the database!" );
@$mysqli_select_db($handle, "phpherexamen" ) or die( "Connected to the database, but there's nothing here!" );
but Mysqli requires an object to know which connection the mysql select db should apply to.
Sidenote: The old extension MySQL that was replaced by MySQLi supported to cache the last connection so you didnt need to specify the database handle but this is a great error-magnet if you have a website using multiple connections or want to fire a query while looping a result or similar thatswhy this only works with a valid handle or better said object which is alot more sane then the other, old method.