prepare(" INSERT INTO Hosts(IpAddress, NetworkId, Hostname, FQDN, MacAddress, Link, Comments) VALUES($ip, $networkId, :i_hostname, :i_fqdn, :i_macAddress, :i_link, :i_comments) ON DUPLICATE KEY UPDATE Hostname = :u_hostname, FQDN = :u_fqdn, MacAddress = :u_macAddress, Comments = :u_comments, Link = :u_link "); $update->execute([ 'i_hostname' => $hostname, 'i_fqdn' => $fqdn, 'i_macAddress' => $macAddress, 'i_link' => $link, 'i_comments' => $comments, 'u_hostname' => $hostname, 'u_fqdn' => $fqdn, 'u_macAddress' => $macAddress, 'u_link' => $link, 'u_comments' => $comments ]); } catch(Exception $e) { header("Location: 500.php"); exit; } ?>