$sql="INSERT INTO survey (user, title, description, opta, optb,optc,optd,time) VALUES ('$user','$title', '$dis', '$a' , '$b', '$c', '$d','timespan')";
if (mysqli_query($con,$sql))
{
echo "Success";
}
else
{
echo "Error: " . mysql_error();
}
echo $id = mysql_insert_id();
mysqli_close($con);
I want to return id of column from table, but it returns 0. why? and also how can i fix this problem? thanks in advance