<?php
$con=mysql_connect('localhost', ' ', ' ') ;
$db=mysql_select_db(' ') ;
$name=$_POST['name'];
$email=$_POST['email'];
$mobile=$_POST'mobile'];
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO user (name, email, mobile)
VALUES ('$name', '$email', '$mobile')";
if ($con->query($sql) === TRUE)
{
echo "New record created successfully";
}
else{
echo "Error: " . $sql . "<br>" . $con->error;
}
$con->close();
?>`
i am trying to insert data into my table but it throwing a error help me to solve this problem .
my error:
syntax error, unexpected ''mobile'' (T_CONSTANT_ENCAPSED_STRING)