Can anyone find the bug? This function worked for years, but then I did something very far away (i.e. I didn't change this function at all) which broke it.
Have you updated the server's PHP version, and the error occurs when using the
mysql_ function? Starting with PHP 7, the function should be
mysqli_, which can cause errors. Is that it?