Deprecated: Function create_function() is deprecated in /var/www/vhosts/ on line 70
PHP MySQLi Registration Tutorial |
  • Tuesday , 29 September 2020

PHP MySQLi Registration Tutorial

Code Canyon

How to create a registration page for your website.

Original source

3d Ocean

Related Posts


  1. Dirk Huizinga
    January 28, 2019 at 10:43

    Top video thanx…. one question… how can i build in a email confirmation into?

  2. Cubtra Compagnie
    January 28, 2019 at 10:43

    Hi I hope you are well?
    I took my name Victor, I am 22 years in first year of the BTS in Computer Network and Telecom.
    To practice I created a website in php but I have trouble with my database. The liason is there but I can not connect or open an account.
    At first I use MYSQL and when I proceed to the user account login I encounter a problem that I am advised to use MYSQLI or PDO for my database:

    ( ! ) Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:wamp64wwwnewcoredatabaseconnect.php on line 8

    I tried but no change. I do not know what approach to use. If you please, I will send you the site in compressed form by your email so that you can help me. My email is

    Thank you

  3. Lemuel John
    January 28, 2019 at 10:43

    thank you so much you helped me a lot man.. keep it up

  4. Florence Mathrix
    January 28, 2019 at 10:43

    thank you sir

  5. Yassine Uk
    January 28, 2019 at 10:43

    Not Work for me <?php
    $output = NULL;

    if (isset($_POST['submit'])){

    //connect to database a habibi
    $mysqli = NEW MySQLi('localhost','root','','socres');

    $username = $mysqli->real_escape_string($_POST['username']);
    $email = $mysqli->real_escape_string($_POST['email']);
    $password = $mysqli->real_escape_string($_POST['password']);
    $cpassword = $mysqli->real_escape_string($_POST['cpassword']);
    $gender = $mysqli->real_escape_string($_POST['gender']);

    $query = $mysqli->query("SELECT * FROM users WHERE username = '$username'");

    if(empty($username) OR empty($email) OR empty($password) OR empty($cpassword) OR empty($gender)){
    $output = "Please Fill in All Fields.";
    }elseif($query->num_rows != 0){

    $output = "that username already Taken.";
    }elseif ($cpassword !=$password) {
    $output = "Youre password Do'nt Match.";
    }elseif (strlen($password) < 6) {
    $output = "Youre password must be at least 5 characters.";
    //Encryption Password
    $password =md5($password);
    //insert the record
    $insert = $mysqli->query("SELECT INTO users (username,email,password,gender) VALUES('$username','$email','$password','$gender')");
    if ($insert != TRUE){
    $output = "There Was a Problem <br />.";
    $output .= $mysqli->error;
    $output = "You Have Been Registred!";




  6. Yogita Jain
    January 28, 2019 at 10:43

    Thanks alot

  7. Botond Gáll
    January 28, 2019 at 10:43

    Thank you! 🙂

  8. Zack zaks
    January 28, 2019 at 10:43

    I would like to take this opportunity to highly appreciate and thank you for the wonderful work. i finally understood what i have been trying to understand for awhile.
    i would like to contact u directly for future questions i might be having.

  9. it is i, the frenchiest fry
    January 28, 2019 at 10:43

    "Parse error: syntax error, unexpected 'if' (T_IF) in C:xampphtdocsloginregisterindex.php on line 17"

    i got this error, help?

  10. John Lloyd Manansala
    January 28, 2019 at 10:43

    the md5 encryption doesnt work for me :((((( i

  11. Nakul Sarkar
    January 28, 2019 at 10:43

    When i reload the page it will automatically inserted last input data
    in the database. If i reload again then it will again inserted last
    input data. Also if i put new data then it inserted the current new
    data. again after inserted new data if i reload the page (without
    giving nothing in the input field) then it automatically inserted last
    new data.

    student_name student_city
    DON india
    DON india (same data )


    <title>insert data in database using mysqli</title>
    <link rel="stylesheet" type="text/css" href="style.css">
    <form id="form1" method="post" action="<?php echo
    htmlspecialchars($_SERVER['PHP_SELF']); ?>">
    <label>Student Name :</label>
    <input type="text" name="stu_name" id="name" required="required"
    placeholder="Please Enter Name"/><br /><br />

    <label>Student City :</label>
    <input type="text" name="stu_city" id="city" required="required"
    placeholder="Please Enter Your City"/><br/><br />

    <input type="submit" name="submit" id="submit" value="Submit Data" /><br />


    $servername = "localhost";
    $username = "root";
    $password = "";
    $dbname = "college";

    $conn = new mysqli($servername, $username, $password, $dbname);
    // Check connection

    if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);

    //$name = $email = $city = "";
    $name= ($_POST['stu_name']);
    $city= ($_POST['stu_city']);
    echo "$name" . "<br/>";
    echo "$city" . "<br/>";

    $sql = "INSERT INTO students (student_name, student_city) VALUES
    echo "$sql";

    if (mysqli_query($conn,$sql))
    echo "<br/> " . "<br/> " . "<br/> " . "New record created


    //echo "<br/> " . "<br/> " . "<br/> " . "Not successfull";





    please help me —-i dont want want to redirect the page to other page…….for processing……

  12. WOLV
    January 28, 2019 at 10:43

    Thanks, I've watched 20 tutorials and this is the only good one with clear instructions!

  13. phpBasics
    January 28, 2019 at 10:43

    Before you get too far along, I made an error. It's really REAL_ESCAPE_STRING

  14. Aon Doe
    January 28, 2019 at 10:43

    Thank you so much, you're such a great teacher. Your videos are really easy to follow. I said thank you in another video, but this was an awesome breakdown.

  15. colby hoover
    January 28, 2019 at 10:43

    Thank you so much!

Leave A Comment

You must be logged in to post a comment.