JeViCo Posted April 24, 2018 Share Posted April 24, 2018 Hello everyone! Maybe i'm in wrong section but still it related to scripting i guess Could you check me please? dbPoll(dbQuery(db, "SELECT COUNT(Account) FROM AllAccTable WHERE acc = ?", toJSON(getAccountName( acc ))), -1) I want to count rows in table AllAccTable in Account column where acc matches with current player's account name (for example i want to get all rows with certain player from 9999 rows) Link to comment
Dimos7 Posted April 24, 2018 Share Posted April 24, 2018 (edited) dbPoll(dbQuery(db, "SELECT COUNT(Account ) * FROM AllAccTable WHERE acc=?", toJSON(getAccountName(acc))), - 1) Edited April 24, 2018 by Dimos7 Link to comment
JeViCo Posted April 25, 2018 Author Share Posted April 25, 2018 adding * creates an error. dbPoll(dbQuery(db, "SELECT COUNT(Account) FROM AllAccTable WHERE acc = ?", toJSON(getAccountName( acc ))), -1) My code returns number 1 even when the database is empty/ Help! Link to comment
idarrr Posted April 27, 2018 Share Posted April 27, 2018 That query should work and return zero as column COUNT(Account) Should be like this result[1]["COUNT(Account)"] Link to comment
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