Raaoul schreef:Oke!gebruik socket.set(), niet socket.xxx = xxx;
Heb nu 2 vragen of mySQL:
Hoe kan ik nog LIMIT 1, of ORDER BY toevoegen (@ regel 3)
Hoe kan ik waardes met elkaar vergelijken? Als result.founds nu 1 is staat er not works?
Codeblok (voorbeeld.php):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var founds;
var where = {username: username.value };
mysql.query("SELECT COUNT(id) AS founds FROM users WHERE ? ", where, function(err, result) {
console.log(result); // { founds: 1 }
if(err) {
throw err;
} else {
founds = result.founds;
if(founds == 1 || founds == 1) {
console.log("works");
} else {
console.log("not works");
}
}
});
58:
14: