Weii. Posted March 23, 2014 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
Moderators IIYAMA Posted March 23, 2014 Moderators Posted March 23, 2014 Depends how strong the server is, but yes it will use more memory then normal.
Baseplate Posted March 23, 2014 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?
Weii. Posted March 23, 2014 Author 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...
Moderators IIYAMA Posted March 23, 2014 Moderators Posted March 23, 2014 I have no knowledge of mysql, only lua.
Noki Posted March 23, 2014 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.
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