Weii. Posted March 23, 2014 Share Posted March 23, 2014 I have a question if I add a mysql into looping function will cause server to lag ? I can't realy test it, but if there would be 50 players on server will server lagg? Code looks someting like that: function test() for index, player in ipairs(getElementsByType("player")) do dbQuery(con, "UPDATE ....") end end Link to comment
Moderators IIYAMA Posted March 23, 2014 Moderators Share Posted March 23, 2014 Depends how strong the server is, but yes it will use more memory then normal. Link to comment
Baseplate Posted March 23, 2014 Share Posted March 23, 2014 Depends how strong the server is, but yes it will use more memory then normal. Besides, why to use "UPDATE" syntax with dbQuery? Link to comment
Weii. Posted March 23, 2014 Author Share Posted March 23, 2014 Thanks IIYAMA! Besides, why to use "UPDATE" syntax with dbQuery? I just use it for this example, I use exports to my mysql resource... Link to comment
WhoAmI Posted March 23, 2014 Share Posted March 23, 2014 To inserting/updating things use dbExec. Link to comment
Moderators IIYAMA Posted March 23, 2014 Moderators Share Posted March 23, 2014 I have no knowledge of mysql, only lua. Link to comment
Noki Posted March 23, 2014 Share Posted March 23, 2014 Instead of using a loop, you can trigger a server-side event from client-side, and pass the local player over. 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