简体   繁体   中英

PHP/SQL inserts into middle of table?

Recently, I had to modify my php.ini file for the first time to change allow_url_fopen , but my particular web host needed me to create a new php.ini to modify any of its default settings. So I did, and all it contains now is allow_url_fopen = 1 , and all was well with the world.

But now I'm getting weird behavior when inserting new rows in my MySql table. I did not change any PHP or SQL related to this, but now when I insert a new row, it is inserted somewhere in the middle of the table, rather than at the end of the table. I've been using the same code for months now and it's been working fine up until now.

Could creating a new php.ini file have messed with these preferences somehow? Searching through the internet turned up with absolutely nothing.

Edit: There is a rather clear pattern now: Rows by ID are being placed like this at the end of the table:

+-----+
| id  |
+-----+
| 300 |
| 301 |
| 302 |
| 320 |
| 319 |
| 318 |
| 317 |
| 316 |
| 315 |
| 314 |
+-----+

...and so on.

您可以通过单击phpmyadmin中的ID来对它们进行排序,或者对于度假村,请尝试以下操作:

ALTER TABLE `table` ORDER BY `id` ;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM