我需要通过 phpmyadmin 的查询插入新的增量值
INSERT INTO `ps_feature_shop`(`id_feature`, `id_shop`) VALUES ( '1', '1')
其中 id_shop
始终为 1,id_feature
应按我将决定的具体数字递增,例如从 1 到 1000 或从 2000 到 30000。
我该怎么做?
最佳答案
如果你想在 php 代码中使用,这可能会帮助你
<?php
$startValue=1;
$endValue=1000;
function insertValue($startValue,$endValue){
for($i=$startValue;$i<=$endValue;$i++){
INSERT INTO `ps_feature_shop`(`id_feature`, `id_shop`) VALUES ( $i, '1');
}
}
?>
关于mysql - 插入mysql查询自增,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22943540/