CrosRoad95 Posted March 27, 2017 Posted March 27, 2017 is possible to select from mysql using 1 select which output like this in { ["name"]="mynickanem", ["other_column"]="kldsjskldjf", ["licenses"]={ { ["name"]="driver", ["ban"]=0, } { ["name"]="gun", ["ban"]=0, } } } from 2 tables "accounts" and "licenses"
NeXuS™ Posted March 27, 2017 Posted March 27, 2017 Try this: local nrQuery = dbQuery(dbConnection, "SELECT * FROM accounts UNION SELECT * FROM licenses") local rQuery = dbPoll(nrQuery, -1) outputChatBox(toJSON(rQuery)) I dont know if UNION works here. Did I help you? NeXuS™#0001
Om. Posted March 29, 2017 Posted March 29, 2017 Instead or outputChatBox and JSON, You can use iprint function to print the table Looking for a developer? Feel free to PM me
3aGl3 Posted March 29, 2017 Posted March 29, 2017 I don't think a UNION is quite what he wants, furthermore I doubt it'll even work, considering that this is one of the UNION operators requirements: Quote The columns must also have similar data types This would be more what he wants: SELECT * FROM players WHERE player_id=? JOIN licenses ON players.player_id=licenses.player_id ...however it'll not give you exactly what you are looking for. Read more on JOINs here: W3Schools
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