Jump to content

Select * from Table where ....


'LinKin

Recommended Posts

Posted

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, xD, 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

Posted

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?

Posted
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...