Kelly003 Posted October 3, 2021 Share Posted October 3, 2021 how to do that if no row is selected, nothing is done, and if row 1 is selected, it performs the first function (already written by me) and if we select row 2, it performs the second function? Link to comment
The_GTA Posted October 3, 2021 Share Posted October 3, 2021 3 hours ago, Kelly003 said: how to do that if no row is selected, nothing is done, and if row 1 is selected, it performs the first function (already written by me) and if we select row 2, it performs the second function? If you have performed a SELECT with an ORDER BY condition then you can depend on the order of the returned rows. By using dbPoll or dbQuery you can obtain an indexed table of returned rows. If you loop over the rows by index, you can execute code that depends on the index. By using a Lua if-condition that depends on the loop index you can execute different code depending on the row index. Does that make sense to you? Link to comment
Kenix Posted October 3, 2021 Share Posted October 3, 2021 (edited) You can use if else statement depends on field 'type' for example Edited October 3, 2021 by Kenix Link to comment
Kelly003 Posted October 4, 2021 Author Share Posted October 4, 2021 Kenix I know it, but I don't know what is the function to do it. Link to comment
The_GTA Posted October 4, 2021 Share Posted October 4, 2021 2 hours ago, Kelly003 said: Kenix I know it, but I don't know what is the function to do it. Can you show what you have scripted so far? You say that you have no idea but we could tell you if you made a good attempt anyway or what is missing from your current approach. 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