↳ See other learning resources

Using mysqli in PHP

$db=mysqli_connect("localhost","root","","project");

// Get
$stmt=$db->query("SELECT * FROM vendors WHERE email=?");
$stmt->bind_param("s", $email);
$user=$stmt->fetch_assoc();

// Insert
$stmt=$db->prepare("INSERT INTO email (`email`) VALUES (?)");
$stmt->bind_param("s", $email);
$stmt->execute();