ma2med Posted May 9, 2015 Posted May 9, 2015 Salut, je voudrais un moyen pour récupérer l'ID d'un account de la base de donnée internal.db car mon serveur a plus de 400 comptes inscrits et parmi ceux la il y a des comptes supprimés et trié ces comptes seraient trop longs donc j'ai essayé d'utiliser dbConnect mais impossible.... Aidez-moi je vous en prie!
Walid Posted May 9, 2015 Posted May 9, 2015 Salut, je voudrais un moyen pour récupérer l'ID d'un account de la base de donnée internal.db car mon serveur a plus de 400 comptes inscrits et parmi ceux la il y a des comptes supprimés et trié ces comptes seraient trop longs donc j'ai essayé d'utiliser dbConnect mais impossible....Aidez-moi je vous en prie! essayer d'utiliser ce code. local db = ":/internal.db" function getAccountID(accountName) local check = dbPoll(dbQuery(db, "SELECT * FROM accounts WHERE name = ? ",tostring(accountName)), -1) if type(check) ~= "table" or #check ~= 0 or check then return tonumber(check[1]["id"]) else return false end end je n'ai pas testé le. Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
ma2med Posted May 9, 2015 Author Posted May 9, 2015 Salut, je voudrais un moyen pour récupérer l'ID d'un account de la base de donnée internal.db car mon serveur a plus de 400 comptes inscrits et parmi ceux la il y a des comptes supprimés et trié ces comptes seraient trop longs donc j'ai essayé d'utiliser dbConnect mais impossible....Aidez-moi je vous en prie! essayer d'utiliser ce code. local db = ":/internal.db" function getAccountID(accountName) local check = dbPoll(dbQuery(db, "SELECT * FROM accounts WHERE name = ? ",tostring(accountName)), -1) if type(check) ~= "table" or #check ~= 0 or check then return tonumber(check[1]["id"]) else return false end end je n'ai pas testé le. Bonsoir, cela ne marche toujours pas, voici l'erreur: [19:33:31] WARNING: groups\server.lua:20: dbPoll failed; no such table: accounts
Walid Posted May 9, 2015 Posted May 9, 2015 il faut utliser le comme ça local db = ":/internal.db" local con = dbConnect("sqlite", db) function getAccountID(accountName) local check = dbPoll(dbQuery(con, "SELECT * FROM accounts WHERE name = ? ",tostring(accountName)), -1) if type(check) ~= "table" or #check ~= 0 or check then return tonumber(check[1]["id"]) else return false end end Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
ma2med Posted May 9, 2015 Author Posted May 9, 2015 il faut utliser le comme ça local db = ":/internal.db" local con = dbConnect("sqlite", db) function getAccountID(accountName) local check = dbPoll(dbQuery(con, "SELECT * FROM accounts WHERE name = ? ",tostring(accountName)), -1) if type(check) ~= "table" or #check ~= 0 or check then return tonumber(check[1]["id"]) else return false end end Oui je l'utilise comme ça et l'erreur c'est bien celle que j'ai mentionner: [19:33:31] WARNING: groups\server.lua:20: dbPoll failed; no such table: accounts
Walid Posted May 9, 2015 Posted May 9, 2015 Oui je l'utilise comme ça et l'erreur c'est bien celle que j'ai mentionner: [19:33:31] WARNING: groups\server.lua:20: dbPoll failed; no such table: accounts vérifiez votre internal.db s'il y a une table (accounts). ou vérifiez le chemin de votre internal.db Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
Walid Posted May 9, 2015 Posted May 9, 2015 Ok, merci derien Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now