0

I am new to MySQL and PHP. I have spent several hours on my .html page and my .php page. I am using XAMPP and PhpStorm. When I enter my data, I get a "Failure" result. Any help would be greatly appreciated. NOTE: I know I should be using POST rather than GET.

<?php
//Variables from EditUser.html
$FName = $_GET['FName'];
$LName = $_GET['LName'];
$UName = $_GET['UName'];
$Pass = $_GET['password'];
$Role = $_GET['Role'];

print_r($_GET);

$host="localhost";
$user="root";
$password="";
$database="techinfo";

$connect = mysqli_connect($host,$user,$password,$database);
if(!$connect){die("Connection Failed");}
$sql = "INSERT INTO techinfo.techs (DBFN, LName, Username, password, Role)
        VALUES ('$FName', '$LName','$UName','$Pass','$Role'))";
if(mysqli_query($connect,$sql)){echo "New record created";}
else{echo "Failure";}
mysqli_close($connect);
?>
chris85
  • 23,846
  • 7
  • 34
  • 51
Wilks
  • 1

0 Answers0