why when i try to add ( ‘ ) in input , it give me an error like this :
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ”’ at line 1
example for the code :
// build dynamic SQL statement
$SQL = “SELECT ∗ FROM table WHERE field = ‘$_GET[“input”]’;”;
// execute sql statement
$result = mysql_query($SQL);
// check to see how many rows were returned from the database
$rowcount = mysql_num_rows($result);
// iterate through the record set returned
$row = 1;
while ($db_field = mysql_fetch_assoc($result))
{
if ($row <= $rowcount)
{
print $db_field[$row]. “<BR>”;
$row++;
}
}
Continue reading Why does a single-quote cause an error in my application?→