I am very new to php and writing what I thought was a simple php page to insert data into a mysql table. The table only holds a date and two integers. The problem is with the integers. The code works fine for numbers 1 - 100 but when I enter a zero ( 0 ) it will not insert the data. I'm sure there is a simple explanation but I can't find it. Any help is appreciated.
<?php
error_reporting(0);
require 'db/connect.php';
require 'db/security.php';
if (!empty($_POST)) {
if (isset($_POST['logDate'], $_POST['shiftID'], $_POST['deployed'])) {
$date = trim($_POST['logDate']);
$shiftID = trim($_POST['shiftID']);
$deployed = trim($_POST['deployed']);
$logDate = date('Y-m-d', strtotime($date));
if (!empty($logDate) && !empty($shiftID) && !empty($deployed)) {
$insert = $db->prepare("INSERT INTO info
(logDate, shiftID, deployed)
VALUES (?,?,?)");
$insert->bind_param('sii', $logDate, $shiftID, $deployed);
if ($insert->execute()) {
header ('location: test1.php');
die();
}
}
}
}