Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $host = $_SERVER['HTTP_HOST'];
- $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
- $Ice = $_POST["Ice"];
- //Constructing the query out of the received data
- $query = "SELECT Name
- FROM Drinks D
- WHERE D.Ice === '$Ice'
- //connecting to the mysql
- $con = mysql_connect("localhost","root","tackle") or die('Unable to connect to mysql' . mysql_error());
- //connecting to the database
- mysql_select_db("LastDefender") or die("Unable to connect to the database" . mysql_error());
- //running the query
- $returnValue = mysql_query($query, $con);
- //closing the connection to the database
- mysql_close($con);
- $_SESSION['data'] = "";
- if(!$returnValue){
- die('Could not get data: ' . mysql_error());
- }else{
- $row = mysql_fetch_assoc($returnValue);
- $_SESSION['data'] =
- "<table>
- <tr><td>Name</td>
- </tr>
- <tr><td>" . $Ice . "</td>
- </tr>
- </table>";
- header("Location: http://".$host. "/Result.php");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement