Jump to content

% Character - MySQL


'LinKin

Recommended Posts

Posted

Hello,

When I am going to search the row(s) where a column matches this symbol: %

MySQL returns me every row from the Database!

But it doesn't return me the value of the column where I search for the matches.

I'm using this code to make the searches:

local theQuery = dbPoll(dbQuery(dbHandler, "SELECT * FROM `myTable` WHERE `myColumn` LIKE ?", "%"..theArg.."%"), -1) 

Note that the variable 'theArg' is the string that I'm looking matches for. So in this case it is '%'

I've seen that % symbol has a special use in MySQL, however I don't understand what it really does.

Posted

As far as i know it works like a wild card.. so if you search for b, it will return anything that contains b, so for example ab, abc, or bc..

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...