I am trying to insert into table with PHP and MySQL but the page only refresh it self when i press the button.
I haven't done debugging, i have an IF statement that displays any errors that fires if the SQL query have errors. But the thing is even the trigger_error doesnt return anything back to me so i can see whats the problem is.
I never come to this kind of problem before and i have no left ideas in my head so i can fix this.
`
<?php
if(isset($_POST["submitGirl"])) {
$name = $_POST['girlName'];
$url = $_POST['instaProfLink'];
$profilepic = $_POST['profilepic'];
$pic1 = $_POST["pic1"];
$pic2 = $_POST["pic2"];
$pic3 = $_POST["pic3"];
$pic4 = $_POST["pic4"];
$pic5 = $_POST["pic5"];
$tags = $_POST["tags"];
$sql = "INSERT INTO modelprofile VALUES ('', '".htmlentities($name)."', '".htmlentities($url)."', '".htmlentities($profilepic)."', '".htmlentities($pic1)."', '".htmlentities($pic2)."', '".htmlentities($pic3)."', '".htmlentities($pic4)."', '".htmlentities($pic5)."', '".htmlentities($tags)."')";
$result = $conn->query($sql);
if($result === false) {
trigger_error("A required file did not exist!", E_USER_ERROR);
trigger_error('Wrong SQL: ' . $sql . ' Error: ' . $conn->error, E_USER_ERROR);
} else {
echo "model added";
}
}
?>
submitGirl
is the name of the button. When user press, it should add the rest info into database table, from the fields above