By akamarvin on
How can i use the '%' multiple character wildcard in a query when the '%' is used to specify the arguments in that query ?
If I use it, it casts the error of too few args for the sprintf in db_query().
Replacing the '%' with the right number of its single character equivalent '_' does the job for my case.
But someday someone (me?) will need multiple character wildcard in his queries.
Comments
sprintf
The PHP function used is sprintf. To place a literal percentage sign, just double it. E.g. to do a wildcard search for records which start with a given string:
Thanks
Thanks a lot, why didn't I thought about watching the sprintf() documentation.
So obvious ; feel a little dumb.
small error
Just noticed the error. Should be '%%s%' & not '%s%%'.