Im having a hard time solving this error about MySQL Syntax
.
Here is the MySQL syntax
try
{
SQL = "INSERT INTO payment_history_tbl (id, payment_type, date, time, amount, student_no) VALUES (NULL, '" + cmbbxPaymentType.Text + "', CURRENT_DATE(), CURRENT_TIME(), '" + txtbxPaymentAmt.Text + "', '" + msktxbxStudNo.Text + "'";
// INSERT INTO `studentpaymentqueuing`.`payment_history_tbl` (`id`, `payment_type`, `date`, `time`, `amount`, `student_no`) VALUES (NULL, 'Certificate of Enrollment', '2017-02-24', '10:19:28', '60.00', '13-0695');
cmd = new MySqlCommand(SQL, conn);
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Error message:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Any idea?