I am pretty new at php but I think I have an understanding of its logic.
I have a table in a database called Announcements. One of the fields is called Principal_Messa ge. The other fields in the table are Important_Event s and Daily_Announcem ents. I just want to post data to Principal_Messa ge using a form and I want to post to the other fields using other forms. I have created the form and a review page to review the data for the field before it is posted. I have created a processing page to actually post the data to the table. Its code is
[PHP]
$Message = $_POST['princmsg'];
$db = mysqli_connect( "localhost" , "", "", "db-jvadmin");
$sql = "INSERT INTO Announcements (Principal_Mess age) VALUES ('$Message')";
mysqli_query($d b, $sql) or die(mysqli_erro r($db));
[/PHP]
The problem I have is in the processing page, I get the message:
Field 'Important_Even ts' doesn't have a default value.
Right now the table is empty and I am trying to test my pages to see if they work. Does anybody have any suggestions?
I have a table in a database called Announcements. One of the fields is called Principal_Messa ge. The other fields in the table are Important_Event s and Daily_Announcem ents. I just want to post data to Principal_Messa ge using a form and I want to post to the other fields using other forms. I have created the form and a review page to review the data for the field before it is posted. I have created a processing page to actually post the data to the table. Its code is
[PHP]
$Message = $_POST['princmsg'];
$db = mysqli_connect( "localhost" , "", "", "db-jvadmin");
$sql = "INSERT INTO Announcements (Principal_Mess age) VALUES ('$Message')";
mysqli_query($d b, $sql) or die(mysqli_erro r($db));
[/PHP]
The problem I have is in the processing page, I get the message:
Field 'Important_Even ts' doesn't have a default value.
Right now the table is empty and I am trying to test my pages to see if they work. Does anybody have any suggestions?
Comment