$sql="INSERT INTO discussions (name, desc, maker)VALUES('".$_POST[name]."', '".$_POST[desc]."', '$id')"; This is the right way to write you can also write in this manner $sql="INSERT INTO discussions (name, desc, maker)VALUES('".$_POST['name']."', '".$_POST['desc']."', '$id')"; ('".$_POST['name']."' this particular key word can accepts the values perfectly.