<?php $con = new mysqli("host","username","password","database"); echo $con ? 'connected' : 'not connected'; ?>

Read more of this post