Actually, the db contains single quotes, no slashes.
For instance, lastName record in MySQL is O'Brien
The search is done from a prior page that asks which last name, puts that into a variable $LAST
How do I query based on that? The PHP query is:
$result=mysql("$DBName","SELECT ItemID FROM Items WHERE lastName='$LAST'");
Note that there are double quotes in the query phrase, and single around the variable - so the ' mark in O'Brien breaks the query.