Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $input = $_POST['in'];
- $link = pg_connect("dbname=test user=root password=338081");
- $sql = "select * from data where stuff='$input';";
- echo $sql;
- $result = pg_exec($link, $sql);
- $numrows = pg_numrows($result);
- echo "<table>";
- for($i = 0; $i < $numrows; $i++) {
- echo "<tr>";
- $row = pg_fetch_array($result, $i);
- echo "<td>" . $row[0] . "</td>";
- echo "<td>" . $row[1] . "</td>";
- echo "</tr>";
- }
- echo "</table>";
- ?>
- <html>
- <head>
- </head>
- <body>
- <form action="" method="post">
- <input type="text" name="in"/>
- <input type="submit" value="Submit"/>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement