CodeIgniter Forums
asynchronous db call - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: asynchronous db call (/showthread.php?tid=2716)



asynchronous db call - El Forum - 08-21-2007

[eluser][email protected][/eluser]
Hey guys,

I am using the db->simple_query('call procedure();');

and was wondering if this call is asynchronous?

If not, how can I make an asynchronous db call? The procedure takes a while and i don't want the web user waiting that long

???any other ideas???

thanks.


asynchronous db call - El Forum - 08-21-2007

[eluser]rogierb[/eluser]
Use an Ajax to call the query you want. I use a javascript library (jquery) to do the dirty work. But there are a good number of other libraries/script out there.

What you do:

1: call a page/controller with Ajax when an event is fired(like onclick)
2: in the called controller do your database magic(model)
3: after the query is done, parse the result in a view
4: show the result in any (block)element you want.

et voila..


asynchronous db call - El Forum - 08-21-2007

[eluser][email protected][/eluser]
Thank you.
That will work; however, I don't even care about the results, I just want to fire the procedure off and continue within the controller.

Is there any way to do it without ajax, but within a controller.


asynchronous db call - El Forum - 08-21-2007

[eluser]alpar[/eluser]
i believe that there is an option to tell Mysql that you don't care about the results. There is a keyword or something i can't remember exactly to give you a syntax and i don't have the time to look it out, but if you can't find anything tell me and when i have the time i will look it out, or someone who knows it will post it, i think that the word is delayed but i'm not sure.


asynchronous db call - El Forum - 08-21-2007

[eluser]Michael Wales[/eluser]
Good find alpar - here's the MySQL.com Documentation for DELAYED.