Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hello i need to create a form that adds Data to a MySQL Database using PHP.
I created this, but it does not work
THIS NEEDS TO BE ADDED:
INSERT INTO `mailserver`.`virtual_users`
(`domain_id`, `password` , `email`)
VALUES
('5', ENCRYPT('newpassword', CONCAT('$6$', SUBSTRING(SHA(RAND()), -16))) , 'email3@newdomain.com');
It would be also nice that PHP queries the latest domain_id and adds a 1 after every new Email Address
<!DOCTYPE html>
<html>
<head>
<title>Add an E-Mail</title>
</head>
<body>
<?php
if(isset($_POST['submit'])){
$servername = "localhost";
$username = "lalalala";
$password = "heheheh";
$dbname = "mailserver";
try {
$userpassword = = $_POST['password'];
$useremail = = $_POST['email'];
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "
INSERT INTO `mailserver`.`virtual_users`
(`domain_id`, `password` , `email`)
VALUES
('3', ENCRYPT('$userpassword', CONCAT('$6$', SUBSTRING(SHA(RAND()), -16))) , '$useremail');
";
// use exec() because no results are returned
$conn->exec($sql);
echo "New record created successfully";
}
catch(PDOException $e)
{
echo $sql . "<br>" . $e->getMessage();
}
$conn = null;
}
?>
<form action="" method="post">
<p>Email<input type="email" name="email" placeholder="Your Email"></p>
<p><input type="password" name="password" placeholder="Your Password"></p>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
hbarnard
keneucker
keneucker
rich
santoshpatil
Aspiresoftserv
Yakin
Thejaswini-Rao-U
775c69c916d345a7a367d867078ccb
mayricoak
ndam
bc2f52583874402a988f587c00195d