【发布时间】:2012-12-08 17:53:01
【问题描述】:
我有桌子:平台
此表内的列:1. first_scan_date, 2. next_scan_date 3. scan_frequency
现在,我从基于网络的公式中得到了这样的数组:
Array
(
[scan_freq1] => Array
(
[0] => 0
[1] => 0
[2] => 0
[3] => 0
)
[first_scan_date1] => Array
(
[0] => 0000-00-00
[1] => 0000-00-00
[2] => 0000-00-00
[3] => 0000-00-00
)
[next_scan_date1] => Array
(
[0] =>
[1] =>
[2] =>
[3] =>
)
)
如何使用来自 PHP 数组的内容在数据库中更新它?我想我需要像 foreach 这样的东西,但不知道......
更新平台 (first_scan_date,next_scan_date,scan_frequency) VALUES (?,?,?)...
帮助?
【问题讨论】:
-
哦,谢谢,没看过。
-
你想要
insert或update吗? -
如何识别表格的特定行?你想更新表格的所有行吗?
-
它们由平台类型识别:os、mw、net。此示例适用于操作系统,因此 WHERE platformtype='os'。