From 3c20f042a48c58aa46339329a35c792d3439783a Mon Sep 17 00:00:00 2001 From: David Morley Date: Fri, 30 Sep 2011 19:35:01 -0500 Subject: [PATCH] check db for existing data on add --- db/add.php | 27 +++++++++++++++++++++++++++ db/show.php | 2 +- db/tables.sql | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/db/add.php b/db/add.php index 3c6a8db..80f67de 100644 --- a/db/add.php +++ b/db/add.php @@ -1,9 +1,36 @@ ? if (!$dbh) { die("Error in connection: " . pg_last_error()); } - $sql = "SELECT * FROM pods"; + $sql = "SELECT * FROM pods WHERE hidden <> 'no'"; $result = pg_query($dbh, $sql); if (!$result) { die("Error in SQL query: " . pg_last_error()); diff --git a/db/tables.sql b/db/tables.sql index 10e12bf..82f0dd4 100644 --- a/db/tables.sql +++ b/db/tables.sql @@ -2,7 +2,7 @@ CREATE TABLE pods ( id serial8 UNIQUE PRIMARY KEY, domain text UNIQUE NOT NULL, whois text, - hidden text DEFAULT 'no', + hidden text DEFAULT 'yes', ip cidr, ptr text, email text, -- GitLab