tigerman Posted November 29, 2010 Posted November 29, 2010 function testing(thePlayer, command) local players = executeSQLQuery("SELECT milk FROM database") outputConsole("test:", thePlayer) for i, data in ipairs(players) do bauh = data.milk outputConsole("Blabla : " ..bauh, thePlayer) end end addCommandHandler("te", testing) executeSQLCreateTable("database", "milk INT") Ok, this should show all values that are in "milk" database, but it dont do anything, even no errors.. VIEW MY RESOURCES -> https://forum.mtasa.com/viewtopic.php?f=108&t=70956
dzek (varez) Posted November 29, 2010 Posted November 29, 2010 did you store anything? just creating database and reading values will return nothing, as nothing is stored in DB Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
tigerman Posted November 29, 2010 Author Posted November 29, 2010 Yes, it stores wins for players VIEW MY RESOURCES -> https://forum.mtasa.com/viewtopic.php?f=108&t=70956
tigerman Posted November 29, 2010 Author Posted November 29, 2010 yes VIEW MY RESOURCES -> https://forum.mtasa.com/viewtopic.php?f=108&t=70956
Aibo Posted November 29, 2010 Posted November 29, 2010 are you sure? :3 get some SQLite database manager (http://code.google.com/p/sqlite-manager/ for example) and check if there is anything in your database. because it looks like you've edited a wiki example from executeSQLQuery page. and no mentions here that anything was stored in your milk database. PS: better not call your table "database". it can be confusing and no way to tell to which resource it belongs. ?
tigerman Posted November 29, 2010 Author Posted November 29, 2010 16 results in this database, so yes im sure VIEW MY RESOURCES -> https://forum.mtasa.com/viewtopic.php?f=108&t=70956
dzek (varez) Posted November 29, 2010 Posted November 29, 2010 if you are sure it contains data then.. you are outputting it to console - are you checking the console or chatbox? it will be shown only in client console, not server. script looks fine, so if there is a data - it will output to console. if there is no data - there will be no output Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
tigerman Posted November 29, 2010 Author Posted November 29, 2010 Im testing it on local server (windowed mode) so im checking both and still nothing VIEW MY RESOURCES -> https://forum.mtasa.com/viewtopic.php?f=108&t=70956
Aibo Posted November 29, 2010 Posted November 29, 2010 "console" here means player console (~ or F8 key ingame), not server console. ?
tigerman Posted November 29, 2010 Author Posted November 29, 2010 Hah, works fine in F8 ^^ thanks u both VIEW MY RESOURCES -> https://forum.mtasa.com/viewtopic.php?f=108&t=70956
tigerman Posted November 29, 2010 Author Posted November 29, 2010 Now if i only would find out way how to sort/list them by growing like 9 8 4 3 1 etc.. then my life would be perfect VIEW MY RESOURCES -> https://forum.mtasa.com/viewtopic.php?f=108&t=70956
Aibo Posted November 29, 2010 Posted November 29, 2010 executeSQLQuery("SELECT milk FROM database ORDER BY milk DESC") ?
dzek (varez) Posted November 29, 2010 Posted November 29, 2010 i need to do the same: Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
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