Error in inserting data in a table

I am having problem in inserting the values in my table. same code runs good for inserting other informations in another table.

$query=‘INSERT INTO birthdays(names,bdate,bmonth,username,pin) VALUES ("$name","$bdate","$bmonth","$nn","$pp")’;
$run1=mysqli_query($con,$query);
if($run1)
{
?>

alert(‘Name inserted successfully’);

      </script> <?php
  }
  else echo "Error in running query";
  }

If you are a beginner checkout http://bitdegree.org or
https://stackoverflow.com/questions/ask to troubleshoot your code with other developers/coders etc.