CodeIgniter Forums

Full Version: Database Trigger
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
Hi everyone!

I'm doing a messaging module for my CodeIgniter website.

But I have a problem.

How will I be able to update the number of messages for a current user dynamically every time a user would message him or her?

I'm thinking of having a database trigger, but I don't know how will I work on it.

Thanks!

El Forum

[eluser]johnpeace[/eluser]
You could have an Ajax request that runs every 15-30 seconds and looks for new notifications and updates the HTML when one is found.

El Forum

[eluser]Unknown[/eluser]
[quote author="johnpeace" date="1329846754"]You could have an Ajax request that runs every 15-30 seconds and looks for new notifications and updates the HTML when one is found.[/quote]

I'm still a beginner when it comes to AJAX. Do you have an idea on how to properly implement it?

El Forum

[eluser]Mauricio de Abreu Antunes[/eluser]
Most of the pages i have seen use iframe.
You reload your iframe (with ajax code) searching for any changes. :-)