Skip to content
Y
yTube.SITE v8.0.4
media / worlds / tools / internet oddities
YouTube / video information

PHP how to insert into MySQL database

Video information, playback and saved actions.

PHP how to insert into MySQL database

Description: #PHP #course #tutorial

include("database.php");

$username = "Patrick";
$password = "rock3";
$hash = password_hash($password, PASSWORD_DEFAULT);

$sql = "INSERT INTO users (user, password)
VALUES ('$username', '$hash')";

try{
mysqli_query($conn, $sql);
echo"User is now registered";
}
catch(mysqli_sql_exception){
echo"Could not register user";
}

mysqli_close($conn); Close description
      
Videos related to "PHP how to insert into MySQL database"

Related videos are temporarily unavailable.

Try again, or come back later.