I have a database SQL query which updates a table with various fields including strings.
If I include the ' (single quote) literately within the field the query fails.
EG.
$query="UPDATE crew SET last_name='$last_name', first_name='$first_name', other_name='$other_name', village='$village', town='$town', county='$county', tel='$tel', fax='$fax', mobile='$mobile', email='$email', website='$website', comments='$comments', credits='$credits' WHERE crew_id =$crew_id ";
If the comments include a single quote anywhere within the field data the query fails. WHY????
Many thanks.