Hi,
I can fix the issue with your php script.
But I'd like to discuss further details in private chat.
As for me, I am professional Web Developer and co-owner of a web-development team with 17 years experience in custom PHP/SQL Development.
See http://www.thebusinessplace.com. This is one of our best PHP projects. The Business Place is an online matchmaking service connecting investors looking to buy a business and vendors trying to sell a business, as well as brokers, banks, venture capital firms and other business suppliers.
Technologies: LAMP (Linux, Apache, MySQL, PHP5), Zend Framework, OOP, MVC, SVN, SQL, xHTML, CSS, JavaScript, DOM, XML, AJAX.
Contact me if you are interested in my proposal