I have a form to upload to database. if i select panelyes on the form and submit it inserts correctly but sends me a warning about panelno because it was not selected?
Warning : Undefined array key “panelno” in /blah blah blah.php on line 10
<?php
$con = mysqli_connect('localhost', 'mydb', 'mypassword','mydb');
// get the post records
$date = $_POST['date'];
$panelyes = $_POST['panelyes'];
$panelno = $_POST['panelno'];
// database insert SQL code
$sql = "INSERT INTO firesystem (date, panelyes,panelno) VALUES ('$date', '$panelyes', '$panelno')";
// insert in database
$rs = mysqli_query($con, $sql);
if($rs)
{
echo "Contact Records Inserted";
}
?>