I need to make a copy of the table mac_track_ports.
I inserted the code into poller_mactrack.php
Code: Select all
db_execute("INSERT INTO mac_track_ports
(site_id, device_id, hostname, dns_hostname, device_name,
vlan_id, vlan_name, mac_address, vendor_mac, ip_address,
port_number, port_name, scan_date, authorized)
SELECT site_id, device_id, hostname, dns_hostname, device_name,
vlan_id, vlan_name, mac_address, vendor_mac, ip_address,
port_number, port_name, scan_date, authorized
FROM mac_track_temp_ports
ON DUPLICATE KEY UPDATE site_id=VALUES(site_id), hostname=VALUES(hostname),
device_name=VALUES(device_name), vlan_id=VALUES(vlan_id), vlan_name=VALUES(vlan_name),
vendor_mac=VALUES(vendor_mac), ip_address=VALUES(ip_address), dns_hostname=VALUES(dns_hostname),
port_name=VALUES(port_name), authorized=VALUES(authorized)");
db_execute("INSERT INTO mac_track_ports_double
(site_id, device_id, hostname, dns_hostname, device_name,
vlan_id, vlan_name, mac_address, vendor_mac, ip_address,
port_number, port_name, scan_date, authorized)
SELECT site_id, device_id, hostname, dns_hostname, device_name,
vlan_id, vlan_name, mac_address, vendor_mac, ip_address,
port_number, port_name, scan_date, authorized
FROM mac_track_temp_ports
ON DUPLICATE KEY UPDATE site_id=VALUES(site_id), hostname=VALUES(hostname),
device_name=VALUES(device_name), vlan_id=VALUES(vlan_id), vlan_name=VALUES(vlan_name),
vendor_mac=VALUES(vendor_mac), ip_address=VALUES(ip_address), dns_hostname=VALUES(dns_hostname),
port_name=VALUES(port_name), authorized=VALUES(authorized)");
mac_track_ports_double - no
I checked the permissions on new mysql table - all is OK.
help!