'LinKin Posted June 16, 2014 Share Posted June 16, 2014 Hello, I want to select the rows from a certain table that contain a string in one of its columns. More explained: Serial___________Nicknames 182739817298____Link, test, stuff, bla 180009817298____asd, zaa, dada, zimbe 180000017298____ee, , hh, bla How can I select the rows that contain "bla" in the Nicknames column? I'm using MySQL, and the Nicknames column is type TEXT Thanks Link to comment
arezu Posted June 16, 2014 Share Posted June 16, 2014 MTA example: local name = "bla" dbQuery(connection, "SELECT * FROM Table WHERE Nicknames = ?", name) or do you mean when the column "Nicknames" contains "bla" somewhere, where nicknames are seperated by a comma? Link to comment
'LinKin Posted June 16, 2014 Author Share Posted June 16, 2014 Yes, I mean that Arezu.. Just like string.find Link to comment
'LinKin Posted June 16, 2014 Author Share Posted June 16, 2014 local theQuery = dbPoll(dbQuery(dbHandler, "SELECT * FROM `myTable` WHERE `nicknames` LIKE ?", "%"..theArg.."%"), -1) Solved the thing. Now, should I use a fulltext index in the 'nicknames' column? To make queries be faster 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