I am trying to make it simply synchronize concatenated string which starts
before the function and ends after the function. Please see the code
snippet and make it simple to get the output like:
<products>
<proudct_name>Product1</product_name>
<proudct_name>Product2</product_name>
<proudct_name>Product3</product_name>
</products>
Any positive reply will be appreciated.
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : DB_USER,
password : DB_PASS,
database : DB_NAME,
});
connection.connect();
var query = connection.query('SELECT * FROM tbl_product limit 0,3');
var str = '<products>';
query.on('result', function (row) {
str += '<product_name>'row.product_name + '</product_name>';
});
str += '</products>';
console.log(str);
--
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/ee022b25-e5c7-47d1-943b-f0611867719f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.