I'm trying to get the number of rows that contain null or empty fields so that if this number of rows is more than or equal to one, the user is prompted with an alert that tells them to complete these record(s), however I'm getting the error mentioned in the title.
Code:
function incompleteTechLog() {
include 'config.php';
// Connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM tbl_flights WHERE pilot_initial_post IS NULL OR = '' AND is_deleted = '0'"; // program allows for soft deleting so this must be included in the query
$result = $conn->query($sql);
$rows = mysqli_num_rows($result);
if ($rows >= 1) {
echo "<div class='alert alert-warning' role='alert'><strong>Minor Alert! </strong>" . $rows . " tech log(s) are incomplete. Please check all aircraft tech logs.</div>";
} else {
$conn = null;
}
}