DBI, MySQL and apostrophes

Let's assume I have this code which inserts some values into a MySQL database: my $var = "Jake's cake"; $SQL = "INSERT INTO `recipes` (`name`, `stat`) VALUES ('$var', 'ok')"; $my_db->do($SQL) or die "Error!\n"; Executing this will render an error: DBD::mysql::db do failed: You have an error in your SQL syntax; check