Jump to content

Mahmood-Saleh

New Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by Mahmood-Saleh

  1. 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!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.