Yes indeed that is the callback function of the sql.query() function. Under
what command or hook on the server do you have that sql.query() call?

for example If you are executing this call on a 'userJoin' hook or
'connect' you will most likely need to include all/most of your inside
the sql.query() callback.
Here is why


   This is the callback
  ↓
sql.query('query_the_database',function(res,error){
//Callback scope
user.data = res;
});
 //NOTE this is a fake function
broadcast_user_info(user);
 //The code above outside the sql.query() callback
//will not wait for it to make the query to
//the database and run the callback function

The right on doing it is to include the line ''broadcast_user_info(user);'
inside the sql.query() callback

On Mon, Mar 5, 2012 at 7:06 PM, UTAN <[email protected]> wrote:

> Hi Pablo
>
> Thanks for your reply, now I am totally lost must be my lack of
> acknowledge in javascript I thought I was inside a callback
> sql.query(); in the sql query .
>
> Can you give me an example ?
>
> sql.query('query the database',function(res,error){
>
> // res is the callback from the query itself right?
> });
>
> thanks again.
>
> --
> You received this message because you are subscribed to the Google
> Groups "APE Project" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/ape-project?hl=en
> ---
> APE Project (Ajax Push Engine)
> Official website : http://www.ape-project.org/
> Git Hub : http://github.com/APE-Project/
>

-- 
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/

Reply via email to