I posted yesterday about having issues connecting to the database using php but thankfully someone helped me out then. but this time i am having issues inserting data into my database using php script.
This is the code i was doing to just test it out:
<?php
require_once 'connection.php';
$sql = "INSERT INTO test (f_name, l_name, phone_no) VALUES ('Jack', 'Harvey', '4551812626')";
if(mysqli_query($link, $sql)){
echo "Records inserted successfully. ";
} else{
echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
}
mysqli_close($link);
?>
But when i run this php script through my sub domain i get this error:
ERROR: Could not able to execute INSERT INTO test (f_name, l_name, phone_no) VALUES (‘Jack’, ‘Harvey’, ‘4551812626’).
Im not sure what is wrong exactly here as it should connect be able to insert the data.