Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <?php
- $db = pg_connect('host=localhost dbname=taskman user=tendril password=topsecret');
- $name = pg_escape_string($_POST['name']);
- $description = pg_escape_string($_POST['description']);
- $query = "INSERT INTO tasks(name, description) VALUES('".$name."','".$description."')";
- $result = pg_query($query);
- if (!$result) {
- $errormessage = pg_last_error();
- echo "Error with query: " . $errormessage;
- exit();
- }
- echo "<p>Record created.</p>";
- pg_close();
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment