Question: how are we supposed to know if you script will be difficult to port to PHP4?
There can be a thousand reasons why your database functions stopped working, and 999 of them may have nothing at all to do with PHP4.
If you gave us some of the error messages you are getting we might be able to help you.