$sql = "INSERT INTO table (поля) VALUES (:значения)";
$query = $PDO->prepare($sql);
if (!$query) {
echo "\nPDO::errorInfo():\n";
print_r($query->errorInfo());
}
$PDO->beginTransaction();
$PDO->exec("TRUNCATE TABLE table");
foreach($data as $object) {
$query->execute(array(':поля'=>значения));
if (!$query) {
echo "\nPDO::errorInfo():\n";
print_r($query->errorInfo());
}
}
$PDO->commit();
[ 5] Sent 893 datagrams
[ 7] 0.0-10.0 sec 1.25 MBytes 1.05 Mbits/sec
[ 7] Sent 893 datagrams
[SUM] 0.0-10.0 sec 12.5 MBytes 10.5 Mbits/sec
[ 10] WARNING: did not receive ack of last datagram after 10 tries.
[ 11] WARNING: did not receive ack of last datagram after 10 tries.
[ 8] WARNING: did not receive ack of last datagram after 10 tries.
[ 6] WARNING: did not receive ack of last datagram after 10 tries.
eth1 Link encap:Ethernet HWaddr 64:70:02:11:ce:e4
inet addr:ip Bcast:ip Mask:255.255.255.0
inet6 addr: ip/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:128799865 errors:0 dropped:108 overruns:0 frame:0
TX packets:92684301 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:111214808351 (103.5 GiB) TX bytes:97842202608 (91.1 GiB)
Interrupt:45 Base address:0xe000
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Link partner advertised pause frame use: Symmetric
Link partner advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000033 (51)
drv probe ifdown ifup
Link detected: yes