Forum Moderators: open
[3]$Asql ="SELECT Distinct $subcat FROM feed WHERE $catlast LIKE '%".$hyphen."%' ORDER BY $subcat";[/3]
$Asql ="SELECT Distinct " . mysql_real_escape_string($subcat) . " FROM feed WHERE " . mysql_real_escape_string($catlast) . " LIKE '%". mysql_real_escape_string($hyphen) ."%' ORDER BY " . mysql_real_escape_string($subcat) . ""; It's most important for the WHERE and LIKE clauses, but it's a good idea overall because of the special symbol differences between PHP and MySQL.