Hi everyone, I have a select statement that I am going to pass to MYSQL: q1 = "select * from company where company_name = '$company'"; When $company has a special character, then the PHP code fails. For example, if $company is "Barnes & Noble", then it fails. How do I deal with this situation? Thanks in advance.
try q1 = mysql_query("select * from company where company_name = '".mysql_real_escape_string($company)."'"); You can prob get rid of some of the speech marks. play around with it.