steadyfi Posted March 10, 2015 Share Posted March 10, 2015 Hello How can I check in a SQL Table if a column text is equal to what to a var ? Can someone tell me if this is correct ? Code: test = executeSQLQuery("SELECT team FROM openteams.teams") if test == var then --code end Thanks Link to comment
Bonsai Posted March 10, 2015 Share Posted March 10, 2015 Like this? test[1].columnName Link to comment
steadyfi Posted March 10, 2015 Author Share Posted March 10, 2015 Like this? test[1].columnName I don't need a table. I need to check if it the text already exists. I use it for a team script. I save all the team names in a SQL Table. I need to check if the team already exists to not have multiple teams with the same name, and I do that by checking if the TEAMNAME var is equal to any of the team names saved in the SQL Table. I hope you understand Link to comment
Bonsai Posted March 10, 2015 Share Posted March 10, 2015 I guess you could use WHERE to select rows with teamname == var, if the result is empty, its not existing yet. http://www.tutorialspoint.com/sqlite/sq ... clause.htm Link to comment
steadyfi Posted March 10, 2015 Author Share Posted March 10, 2015 I guess you could use WHERE to select rows with teamname == var, if the result is empty, its not existing yet.http://www.tutorialspoint.com/sqlite/sq ... clause.htm Thanks. #SOLVED 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