sprintf is a function in php that allows you to separate the string you want to output and the variables you are using to do so....
PHP Code:
sprintf("STRING %s STRING %i ", $string, $integer);
for more information regarding the function, review the php manual
now as for the MySQL "LIKE" syntax... the percent sign represents a wildcard character, meaning that it can be any single/multiple character(s)
Code:
SELECT city, country, region FROM places WHERE city LIKE 'Par%s'
Checking for values is case-sensitive, meaning if the city is Paris, and you check paris, your query will return no results... MySQL has made a couple of other useful functions to compat this issue.... similar to php's strtolower()...
Code:
SELECT city, country, region FROM places WHERE lower(city) LIKE 'par%s'
Now that query will match any city starting with the characters par in any case (UPPER / lower) ... have any single/multiple additional characters, and end in either a CAPITAL S or a lowercase s
Bookmarks