I have searched and i have tried different suggestion but it's not still working out for me. I don't really know where fault is coming from, I don't know what i am doing wrong. My query keep returning false and this is my code. Kindly help
$con = mysqli_connect($server, $username, $password);
echo "Server Connection Failed". mysqli_error();
echo "Db connection failed";
$query = "
INSERT INTO enrol-form (name, phone, email, package, time)
VALUES ('$name', '$phone', '$email', '$package', now())
$result = mysqli_query($con, $query);
echo "Error Communicating with Database";
//header ("Location: $url");
echo 'Form Submitted!';
Try quoting your table name:
INSERT INTO enrol-form
INSERT INTO `enrol-form`
Edit for clarity: using a dash in the table name requires you to backtick it. A simpler name for the table might be enrolForm, which would not require the backticks.