(id) title contents
(1) Asia This is a continent
(2) China This country is big in population
(3) France This country is in Europe and Paris is its capital
(4) Mongolia Mongol is country
(5) Korea Korea
(6) Germany Germany is in Europe and Berlin is its capital
I have a table like the above.
key1='a'; $key2='p'; $like1='%$key1%'; $like2='%key2%';
SELECT id, title, contents FROM myTable
WHERE contents like ? or contents like ? ORDER BY id
$searchQ=$dbc-> prepare ($sql);
$searchQ->execute([$like1, $like2]);
I am expecting 3 records called like the following but it actually calls NO records.
(2) China This country is big in population
(3) France This country is in Europe and Paris is its capital
(6) Germany Germany is in Europe and Berlin is its capital
What’s wrong in your view?