Commit 448aa19d authored by David Morley's avatar David Morley

add pg start

parent 9da1c03d
<?php
include('config.php');
$dbh = pg_connect("dbname=$pgdb user=$pguser password=$pgpass");
if (!$dbh) {
die("Error in connection: " . pg_last_error());
}
$pingdomurl = pg_escape_string($_POST['pingdomurl']);
$domain = pg_escape_string($_POST['domain']);
$email = pg_escape_string($_POST['email']);
$sql = "INSERT INTO pods (domain, pindomurl, email) VALUES('$domain', '$pingdomurl', '$email')";
$result = pg_query($dbh, $sql);
if (!$result) {
die("Error in SQL query: " . pg_last_error());
}
echo "Data successfully inserted!";
pg_free_result($result);
pg_close($dbh);
?>
\ No newline at end of file
<?php
include('config.php');
$dbh = pg_connect("dbname=$pgdb user=$pguser password=$pgpass");
if (!$dbh) {
die("Error in connection: " . pg_last_error());
}
$sql = "SELECT * FROM pods";
$result = pg_query($dbh, $sql);
if (!$result) {
die("Error in SQL query: " . pg_last_error());
}
while ($row = pg_fetch_array($result)) {
echo "pod" . $row[1] . "<br />";
echo "pingdom: " . $row[2] . "<p />";
}
pg_free_result($result);
pg_close($dbh);
?>
\ No newline at end of file
CREATE TABLE pods (
id serial8 UNIQUE PRIMARY KEY,
domain text UNIQUE NOT NULL,
whois text,
hidden text DEFAULT 'no',
ip cidr,
ptr text,
email text,
guid text,
secure text,
sslvalid text,
Hgitdate text,
Hgitref text,
Hruntime text,
Hencoding text,
pindomurl text,
monthsmonitored int,
uptimelast7 text,
status text,
responsetimelast7 text,
dateUpdated timestamp DEFAULT current_timestamp,
dateLaststats timestamp DEFAULT current_timestamp,
dateCreated timestamp DEFAULT current_timestamp
);
\ No newline at end of file
User-agent: *
Allow: /
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment