Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $user = 'root';//mysqli_connect('127.0.0.1','root','');
- $pass = '';
- $database = 'tennis';
- $db = new mysqli('localhost', $user, $pass, $database) or die("Unable to connect");
- echo "Great work";
- // if(!$user)
- // {
- // echo 'Not Connected To Server';
- // }
- // if (!mysqli_select_db ($user,'tennis'))
- // {
- // echo 'Database Not Selected';
- // }
- echo '<pre>';
- var_dump($_POST);
- echo '</pre>';
- if(isset($_POST['PLAYER_NAME'])){
- $PLAYER_NAME = $_POST['PLAYER_NAME'];
- } else {
- echo 'Need to fill out name';
- }
- //var_dump($_POST);
- if(isset($_POST['Age'])){
- $Age = $_POST['Age'];
- } else {
- $Age = '';
- echo 'Need to fill out name';
- }
- //var_dump($_POST);
- if(isset($_POST['Address'])){
- $Address = $_POST['Address'];
- } else {
- echo 'Need to fill out name';
- }
- //var_dump($_POST);
- if(isset($_POST['Phone'])){
- $Phone = $_POST['Phone'];
- } else {
- echo 'Need to fill out name';
- }
- //var_dump($_POST);
- if(isset($_POST['Hours'])){
- $Hours = $_POST['Hours'];
- } else {
- echo 'Need to fill out name';
- }
- //var_dump($_POST);
- if(isset($_POST['Price'])){
- $Price = $_POST['Price'];
- } else {
- echo 'Need to fill out name';
- }
- //var_dump($_POST);
- if(isset($_POST['Facility'])){
- $Facility = $_POST['Facility'];
- } else {
- echo 'Need to fill out name';
- }
- //var_dump($_POST);
- if(isset($_POST['Instructor'])){
- $Instructor = $_POST['Instructor'];
- } else {
- echo 'Need to fill out name';
- }
- $sql = "INSERT INTO player (PLAYER_NAME,PLAYER_AGE,ADDRESS,PHONE,HOURS_WEEK,PRICE,FAC_NAME,INSTR_NUM) VALUES ('$PLAYER_NAME','$Age','$Address','$Phone','$Hours','$Price','$Facility','$Instructor')";
- $query = mysqli_query($db,$sql);
- echo '<pre>';
- var_dump($sql);
- echo '</pre>';
- /*
- if (!mysqli_query($con,$sql))
- {
- echo 'Not Inserted';
- }
- else
- {
- echo 'Inserted';
- }
- header("refresh:2; url=index.html");
- */
- include 'table.html'
- ?>
Add Comment
Please, Sign In to add comment