Welcome Guest, Not a member yet? Register   Sign In
asynchronous db call
#1

[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.
#2

[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..
#3

[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.
#4

[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.
#5

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




Theme © iAndrew 2016 - Forum software by © MyBB