0
<?php 
if(isset($_POST['fullname'])){
    $filename = $_POST['fullname'];
}
if(isset($_POST['email'])){
    $email = $_POST['email'];
}
if(isset($_POST['password'])){
    $password = $_POST['password'];
}
if(isset($_POST['gender'])){
    $gender = $_POST['gender'];
}
    
    //Database connection
    $conn = new mysqli('localhost','root','','internship');
    if($conn->connect_error){
        die('Connection Failed : '.$conn->connect_error);
    }else{
        $stmt = $conn->prepare("insert into intern (fullname, email, password,gender) values(?,?,?,?)");
        $stmt->bind_param("ssss", $fullname, $email, $password,$gender);
        $stmt->execute();
        echo "sign up succesfully...";
        $stmt->close();
        $conn->close();
    }
 ?>

This is the code for connection and after submitting the form i got the successful message but in phpmyadmin the data is not showing

Álvaro González
  • 135,557
  • 38
  • 250
  • 339
  • 1
    _Side note:_ PHPMyAdmin is just a web based admin gui written in PHP for managing MySQL databases. Your application talks to MySQL directly and has nothing to do with PHPMyAdmin. – M. Eriksson Jul 24 '20 at 06:13
  • 3
    _**Never ever** ever never_ store passwords in plain text! You should _always_ hash the passwords using [password_hash()](https://www.php.net/manual/en/function.password-hash.php) and only store the hashes. Then you can use [password_verify()](https://www.php.net/manual/en/function.password-verify.php) to verify a password against a hash. – M. Eriksson Jul 24 '20 at 06:14
  • You should add some error handling to your mysqli queries. It will make it easier to find issues like this: https://stackoverflow.com/questions/14578243/turning-query-errors-to-exceptions-in-mysqli – M. Eriksson Jul 24 '20 at 06:16
  • `PASSWORD` is a MySQL keyword and shouldn't be used as table/column names. – Progman Jul 24 '20 at 16:30

0 Answers0