ANY Mysql code will fail when running under PHP 7.
There are Xoops functions for just about every MySQL call for 2.5 and should be used instead. Calling mysql or mysqli directly is a bad idea and may not work with 2.6.
Using the Xoops functions will work in all 2.5.x versions of xoops. And will not only work with php 5 but should also work with php 7