Why is mySQL output not procedurally consistent with source code input?
Databases have no concept of "order".

This is so that they can handle millions, billions, and trillions of rows of data without worrying about "order".

If you want output in a specific order, you MUST specify an ORDER BY clause.

This means you need a column you can ORDER BY.

On such column could be an Identity column.  Check your RDBMS documentation for any potential out-of-order possibilities. (Eg oracle RAC Sequence)

Another method is to use a CREATED_ONcolumn.  This a date+time column with sub-second resolution.