This is my first post on this forums, I hope I get what I've expected, anyways xD
I have a MySQL table called People, each row must have 4 structures which are Name, Age, Location and Gender.
This is what I've got so far:
$prepare = $connection->prepare("SELECT * FROM people WHERE name=?");
$prepare->bind_param("s", $name);
$prepare->execute();
$result = $prepare->get_result();
if ($result) {
$insert = $connection->prepare("INSERT INTO people (name, age, location, gender) VALUES (?,?,?,?)");
$insert->bind_param("siss", $name, $age, $location, $gender);
$insert->execute();
echo "true,".$name;
} else {
echo "false,".$name;
}
I don't even know if it's the right way to do it or not, I just tried what I've got after a long search, so correct me if I was wrong.
~Thanks for your time!