根据变量php插入倍数时间

时间:2017-12-12 15:28:45

标签: php mysql variables insert

是否有人知道如何根据变量进行多次插入?

$diff = abs(strtotime($datumtot) - strtotime($datumvan));
$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24) / (60*60*24)); 

这里我得到的结果可以是1到14。

现在我想将其插入数据库。

我的插入语句是一个让我们说天== 3

INSERT INTO example 
        (example_id, name, value, other_value)
VALUES  (100,'Name 1', 'Value 1', 'Other 1'),
        (101, 'Name 2', 'Value 2', 'Other 2'),
        (102, 'Name 3', 'Value 3', 'Other 3'),

有更好的方法吗?检查变量然后插入它有多少?

感谢

0 个答案:

没有答案
相关问题