FAQ
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" 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 nodejs+unsubscribe@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/cc403d67-c255-4edd-9a32-0fc6868f23af%40googlegroups.com
<https://groups.google.com/d/msgid/nodejs/cc403d67-c255-4edd-9a32-0fc6868f23af%40googlegroups.com?utm_medium=email&utm_source=footer>
.
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 nodejs+unsubscribe@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAMT%3Dzo5cM_fYL70tBsbC_O%2Bwpf1VwfO0Th6YMXE2FO1tj8_0sQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 12 | next ›
Discussion Overview
groupnodejs @
categoriesnodejs
postedNov 18, '14 at 1:26p
activeNov 24, '14 at 5:27a
posts12
users6
websitenodejs.org
irc#node.js

People

Translate

site design / logo © 2022 Grokbase