Indsæt dit tabelnavn address
i backticks
Brug af mysqli_
<?php
/start session
session_start();
//establish connection
$con = mysqli_connect("localhost","root","","qoot");
if(!$con)
{
die("connection to database failed".mysqli_error($con));
}
//read the values from form
$unm = $_SESSION['name'];
$fname=$_POST['firstname'];
$lname=$_POST['lastname'];
$ema=$_POST['email'];
$mob=$_POST['mobile'];
?>
<?php
//insert to database
$qry=mysqli_query($con,"INSERT INTO `address` ( firstname, lastname, mobile, email)VALUES('$fname',$lname','$ema','$mob')") or die(mysqli_error($con));
?>
P.S. Jeg vil sige, at du risikerer mysql injection
, tjek her Hvordan kan jeg forhindre SQL-injektion i PHP ?
. Du bør virkelig bruge forberedte udsagn for at undgå enhver risiko.