Possible Duplicate:
Best way to prevent SQL Injection in PHP
In the code below, the field title
and the variable $submission
is a name in text. The query usually works just fine. However, if title
and $submission
contain an apostrophe, the query does not include results.
How can I make the query work with apostrophes?
$submission = $_GET['submission'];
$query2 = "SELECT
title,
1ad1,
1adcit,
1adst,
zip,
1adph,
1site,
neighborhood
FROM
submission
WHERE
title = '$submission'
ORDER BY
neighborhood ASC";