I've just spent some time battling the "fatal error call to undefined function mysql_connect()" message, and as it wasn't clear to me, I thought it may help to say:
php_mysqli does not replace the php_mysql library. It only extends it. You need the php_mysql library !
In order to have these functions available, you must compile PHP with support for the mysqli extension.
The mysqli extension is designed to work with MySQL version 4.1.13 or newer, or 5.0.7 or newer. For previous versions, please see the MySQL extension documentation.
The required extensions will be pulled in automatically on FreeBSD, unless you manually remove them after installation.