You get the error description from the last mysqli-function, not from the last mysql- error. If you have the following ...
php.net