What the author means in this paragraph?

Hello! Read the book by David Sklar English. Reached databases. Several times already re-read this paragraph, but not quite understand the author. What does he mean? What will happen if you use a placeholder (a symbol of substitution, if in Russian) in this situation?
Here's the paragraph
// First, do normal quoting of the value
$dish = $db->quote($_POST['dish_search']);
// Then, put backslashes before underscores and percent signs
$dish = strtr($dish, array('_' => '\_', '%' => '\%'));
// Now, $dish is sanitized and can be interpolated right into the query
$stmt = $db->query("SELECT dish_name, price FROM dishes
 WHERE dish_name LIKE $dish");

You can't use a placeholder in this situation because the escaping of the SQL wild‐
cards has to happen after the regular quoting. The regular quoting puts a backslash
before single quotes, but also before backslashes. If strtr() processes the string first,
a submitted value such as a %chicken% becomes \%chicken\%. Then, quoting the
(whether by quote() or the placeholder processing) turns \%chicken\% into
'\\%chicken\\%'. This is interpreted by the database to mean a literal backslash fol‐
lowed by the “match any characters” wildcard, followed by chicken, followed by
another literal backslash, followed by another “match any characters” wildcard.
However, if quote() goes first, %chicken% is turned into '%chicken%'. Then strtr()
turns it into '\%chicken\%'. This is interpreted by the database as a literal percent
sign, followed by chicken, followed by another percent sign, which is what the user
entered.

Thanks in advance!

UPD:
The question asked on the English forums, but still didn't get it.
June 8th 19 at 16:30
3 answers
June 8th 19 at 16:32
If you need to escape wild cards (%, _) in a row for LIKE a placeholder to use will not work, because quoting that is executed when the placeholder in the placeholder, makes the shielding wildcard-ov:

Then, the quoting (whether by quote() or the placeholder processing) turns \%chicken\% into '\\%chicken\\%'.


Ie screened using strtr interest turned into a full-fledged wildcard-y.

To shielding wildcard-ov does not fly, quoting should go in front of strtr(). Therefore, we remove the placeholder and manually running quote().
June 8th 19 at 16:34
June 8th 19 at 16:36
What the author means in this paragraph?
Here for MS SQL LIKE, to read about the escape_character.

Find more questions by tags SQLPHPSQLite