You have to quote your string values:
$sql = "INSERT INTO qtable(fielda, fieldb, qdata) VALUES ('".$_POST['fielda']."','".$_POST['fieldb']."','".$_POST['qdata']."')";
However, you should not create SQL statements by assembling variables. It is opened to SQL Injection. You should change it to use prepared statements and parameterized queries. See example:
how-can-i-prevent-sql-injection-in-php[
^]