c'è da dire che se è una stringa ha bisogno degli apici/virgolette

$sql = "select * from temp where mm = '$variabile' and aa = '$variabile2'";