Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con=mysql_connect("localhost","root","");
- mysql_select_db("mainm24",$con) or die(mysql_error($con));
- error_reporting(E_ALL ^ E_NOTICE);
- session_start();
- if($_POST){
- $bd = $_POST['bookdate'];
- $fn = $_POST['fname'];
- $ln = $_POST['lname'];
- $em = $_POST['email'];
- $s1="INSERT INTO bookings (first_name, last_name, email, booking_date)VALUES('".$fn."', '".$ln."','".$em."' ,'".$bd."')";
- //$s2="select * from bookings where booking_date = "
- mysql_query($s1) or die (mysql_error($con));
- }
- ?>
- <?php
- $servername = "localhost";
- $username = "id56251_root";
- $password = "*****";
- $database = "id56251_mainm24";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $database);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- echo "Connected successfully";
- if($_POST){
- $bd = $_POST['bookdate'];
- $fn = $_POST['fname'];
- $ln = $_POST['lname'];
- $em = $_POST['email'];
- $s1="INSERT INTO bookings (first_name, last_name, email, booking_date)VALUES('".$fn."', '".$ln."','".$em."' ,'".$bd."')";
- //$s2="select * from bookings where booking_date = "
- mysqli_query($s1) or die (mysqli_error($conn));
- }
- ?>
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- echo "Connected successfully";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement