<?php $link = @mysqli_connect("localhost", "nonexisting_user", ""); if (!$link) { printf("Can't connect to localhost. Errorcode: %d\n", mysqli_connect_errno()); }?>