$sql = "SELECT * FROM orders WHERE order_number>=$lower AND order_number<=$upper";
I migrated servers recently and on the previous server this statement included ALL records between $upper and $lower.
The new server excludes the NULL records between $upper and $lower.
Incomplete orders are saved consecutively without order_number(s); and a NULL value.
I assume there is a setting in the MYSQL.conf file. Or I am using a different version of MYSQL that no longer supports automatically including the NULL value in a query.
MySQL versionnumber ?