简体   繁体   English

PHP / SQL插入表中间吗?

[英]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. 最近,我不得不第一次修改php.ini文件以更改allow_url_fopen ,但是我的特定Web主机需要我创建一个新的php.ini来修改其任何默认设置。 So I did, and all it contains now is allow_url_fopen = 1 , and all was well with the world. 所以我做到了,现在包含的全部是allow_url_fopen = 1 ,对世界来说一切都很好。

But now I'm getting weird behavior when inserting new rows in my MySql table. 但是现在我在MySql表中插入新行时出现了奇怪的行为。 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. 我没有更改与此相关的任何PHP或SQL,但是现在当我插入新行时,它将插入到表中间的某个位置,而不是表的末尾。 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? 创建新的php.ini文件是否可能以某种方式弄乱了这些首选项? 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的行被放置在表的末尾:

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

...and so on. ...等等。

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

ALTER TABLE `table` ORDER BY `id` ;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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