Exception: exception 'mysqli_sql_exception' with message 'No index used in query/prepared statement select count(*) as recordcount from customers where (firstname like ? or lastname like ?) and deleted = 'n' order by lastname, firstname ' in C:\xampp\htdocs\newdimension\_includes\ndAPI.php:776 Stack trace: #0
$db = DB::getMYSQLIConnection(); // Turn on Exceptions mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_ALL); $sqlCount = " select count(*) as recordcount " . " from customers " . " where (firstname like ? " . " or lastname like ?) " . " and deleted = 'n' " . " order by lastname, firstname "; $stmtCount = $db->prepare($sqlCount); $searchString = '%' . $searchString . '%'; $stmtCount->bind_param('ss', $modifiedSearchString, $modifiedSearchString); $stmtCount->execute(); // ERROR IS OCCURRING HERE
From novice to tech pro — start learning today.