Looks like the predefined fetch constants went away with the MySQL extension, so we need to add them before the first function...
//predifined fetch constants
define('MYSQL_BOTH',MYSQLI_BOTH);
define('MYSQL_NUM',MYSQLI_NUM);
define('MYSQL_ASSOC',MYSQLI_ASSOC);
I tested and succeeded.