I was googling on how to store a 1
or 0
as a value. I chose the BIT(1)
datatype:
Then, for user authentication I store that value in a temporary TEMPUSER
object like so inside nodejs
: (gender
a column in my users
table)
db.query('SELECT * from users WHERE id = ' + db.escape(userID) + ' AND password = ' + db.escape(userPassword) + '', function(err, results) {
TEMPUSER = {
gender: results[0].gender
}
});
Now, when I console.log TEMPUSER
using:
console.log('Gender Data: ' +TEMPUSER.gender);
It displays:
How Bizarre? Shouldn't it be displaying 1
or 0
?
Edit:
And the gender row value is set to 1
as well in mysql for this specific user: