Hello Oliver,

Thank you for the code. This is really helpful. 

About the socketio :) i do need it in my application. I am trying to 
implement a chart that is real-time.
nodejs server connects to my database using socket io. 

On Friday, November 21, 2014 1:25:24 PM UTC+5:30, Oliver Leics wrote:
>
> Hi Vasa, 
>
> https://gist.github.com/oleics/36fd5049cf2f848e34a5 
>
> It's not working and I will not finish this gist, but you can use it 
> as a starting point, if you want to. 
>
> Two random notes: 
>
> * I see no need to require fs or socket.io. Stick to the minimum you 
> need, everything else is just confusing, even if require('socket.io') 
> might look cool ^^ 
> * Express is a shortcut for the http-module, a very very handy shortcut. 
>
> Have fun! 
>
>
>
> On Thu, Nov 20, 2014 at 2:24 PM, Vasa <[email protected] 
> <javascript:>> wrote: 
> > Thank you for your reply. 
> > 
> > On Wednesday, November 19, 2014 11:39:11 PM UTC+5:30, Chris Rust wrote: 
> >> 
> >> Every time you have a function that you want to run first, that makes 
> use 
> >> of callbacks, such as: 
> >> 
> >> myFunc(function(err, result) { ... }); 
> >> 
> >> Then you need to place the code you want to run second where ... is. 
> This 
> >> is the asynchronous nature of node. Any code where ... is will not run 
> until 
> >> myFunc is finished internally and calls it's argument function. If 
> there's 
> >> another synchronous function, meaning it doesn't accept a function as a 
> >> parameter, outside of myFunc it will be run first. Otherwise they will 
> be 
> >> driven in order of the events caused by the user. 
> >> 
> >> dbclient.query() needs to be inside of the anonymous (read: unnamed) 
> >> function that's passed to dbclient.connect() 
> >> 
> >> On Nov 19, 2014 7:36 AM, "Vasa" <[email protected]> wrote: 
> >>> 
> >>> Hello Aria, 
> >>> 
> >>> Thank you for pointing out the bug. I am new to PHP :).  I fixed it 
> and 
> >>> my PHP is working fine retrieving the data and charting. 
> >>> But i am trying to move the db queries to my nodejs. So that when a 
> >>> request is made, it queries the db and then tries to chart the data. 
> >>> I have attached my node server. Please help me out. 
> >>> 
> >>> 
> >>> On Tuesday, November 18, 2014 1:21:53 PM UTC+5:30, Vasa wrote: 
> >>>> 
> >>>> Hello noders 
> >>>> 
> >>>> i am trying to generate a chart (using highcharts) with queried data 
> >>>> from Mysql. 
> >>>> I have my data.php file to query the database and create a JSON file. 
> >>>> This JSON file is used by index.php file to draw the chart. 
> >>>> This is not working because the chart is drawn before the sql data is 
> >>>> retrieved. 
> >>>> 
> >>>> I am trying to create a nodejs for the same and i assume this is the 
> >>>> solution to my requirement 
> >>>> 
> >>>> Any advice here 
> >>>> 
> >>>> 
> >>>> 
> >>>> 
> >>> -- 
> >>> Job board: http://jobs.nodejs.org/ 
> >>> New group rules: 
> >>> https://gist.github.com/othiym23/9886289#file-moderation-policy-md 
> >>> Old group rules: 
> >>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines 
> >>> --- 
> >>> You received this message because you are subscribed to the Google 
> Groups 
> >>> "nodejs" group. 
> >>> To unsubscribe from this group and stop receiving emails from it, send 
> an 
> >>> email to [email protected]. 
> >>> To post to this group, send email to [email protected]. 
> >>> To view this discussion on the web visit 
> >>> 
> https://groups.google.com/d/msgid/nodejs/cc403d67-c255-4edd-9a32-0fc6868f23af%40googlegroups.com.
>  
>
> >>> For more options, visit https://groups.google.com/d/optout. 
> > 
> > -- 
> > Job board: http://jobs.nodejs.org/ 
> > New group rules: 
> > https://gist.github.com/othiym23/9886289#file-moderation-policy-md 
> > Old group rules: 
> > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "nodejs" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to [email protected] <javascript:>. 
> > To post to this group, send email to [email protected] 
> <javascript:>. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/nodejs/2b97a7dc-5ffe-496c-8ccf-8b6d684ee2b6%40googlegroups.com.
>  
>
> > 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/bf470b0f-212a-4751-9a8a-b114db93de62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to