Commit aef61119 authored by Manish Kumar's avatar Manish Kumar
Browse files

1.0 with unige db

parent 1fe4e726
module.exports = {
host: "localhost",
/*host: "localhost",
user: "root",
//password: "null",
database: "webpoke"
database: "webpoke"*/
host: "10.25.10.21",
user: "g2",
password: "qP1r7rnfIybWdHKk",
database: "g2"
};
\ No newline at end of file
......@@ -65,7 +65,7 @@ Partie.accept = (id_partie, resultGlobal) => {
return;
}
sql.query('UPDATE etatpoke SET active=1 WHERE id_etat=(SELECT id_etat FROM etatpoke as ep, partie as p, team as t WHERE p.id_partie=? AND ep.id_partie=p.id_partie AND ep.id_team=t.id_team AND p.id_joueur1=t.id_joueur ORDER BY t.id_team LIMIT 1) OR id_etat=(SELECT id_etat FROM etatpoke as ep, partie as p, team as t WHERE p.id_partie=? AND ep.id_partie=p.id_partie AND ep.id_team=t.id_team AND p.id_joueur2=t.id_joueur ORDER BY t.id_team LIMIT 1) ', [id_partie, id_partie], function(err, result) {
sql.query('UPDATE etatpoke SET active=1 WHERE id_etat in (SELECT id_etat FROM (SELECT id_etat FROM etatpoke as ep, partie as p, team as t WHERE p.id_partie=? AND ep.id_partie=p.id_partie AND ep.id_team=t.id_team AND p.id_joueur1=t.id_joueur ORDER BY t.id_team LIMIT 1) as et1) OR id_etat in (SELECT id_etat FROM (SELECT id_etat FROM etatpoke as ep, partie as p, team as t WHERE p.id_partie=? AND ep.id_partie=p.id_partie AND ep.id_team=t.id_team AND p.id_joueur2=t.id_joueur ORDER BY t.id_team LIMIT 1) as et2) ', [id_partie, id_partie], function(err, result) {
if (err) {
console.log("error: ", err);
sql.rollback(function() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment