Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if($_SERVER['REQUEST_METHOD']=='POST') {
- $dbinfo = 'mysql:host=localhost;dbname=db';
- $user = 'root';
- $pass = 'root';
- $link = new PDO($dbinfo, $user, $pass);
- //Create ane execute a MySQL query
- $sql = "SELECT *
- FROM seats"
- $stmt = $link->prepare($sql);
- if($stmt->execute(array($_POST['name']))){
- while($row = $stmt->fetch()) {
- printf($row['name']);
- }
- $stmt->closeCursor();
- }
- }
- ?>
- <!doctype html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <title>Seating Booking</title>
- <meta name="description" content="testing roar">
- <meta name="author" content="Garrett Heinlen">
- <link href="less/style.css" rel="stylesheet" />
- </head>
- <body>
- <form action="page2.php" method="post">
- <input type="text" name="name" value="name" />
- <input type="submit" name="submit" value="submit" />
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement