I have to admit that I don’t know php and that my current script has been inherited ...
It queries the MySQL database with the name cityand returns all instances found in this city.
I had several problems: the first thing to do with hyphens (for example, Stratford-upon-Avon); what was decided with the addition
$searchq = str_replace( '-', ' ', $searchq );
which allows me to enter data into the database without a hyphen.
My remaining problem is related to a foreign accent (in particular: sharp, serious, envelope, cedilla, tilde). I tried a million functions, many of which I found on this site and cannot make it work.
the main php code of my current page is
$searchq = filter_var("%{$_POST['keyword']}%", FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);
$ searchq = str_replace ('-', '', $ searchq);
$sql = "SELECT Image, Chain, Country, City, Top as '', Medium as '', Low as '' FROM Chains WHERE Country LIKE ? OR City LIKE ?";
$prepare = $mysqli->prepare($sql);
$prepare->bind_param('ss', $searchq, $searchq);
$prepare->execute();
$prepare->store_result();
, , , ...
- , ,
?
, , script
EDIT
SQL
ALTER TABLE CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8_general_ci;
, ...
# 1253 - COLLATION 'utf8_general_ci' CHARACTER SET 'utf8mb4'