Updating a notification panel without using loops

My page uses a setInterval jQuery function which periodically calls a php script to update the page's notifications panel.

Is there any way to do the same function without the loop? For example detecting any changes on the database then reloading the panel.