The reason for mysqli_connect_error() not being available as $link->connect_error [looks like an inconsistency superficially] is that at the time mysqli_connect_error() matters (when something goes wrong), $link is null, and therefore not a mysqli object ---> you'd be accessing NULL->connect_error, which can't make any sense.