Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if($_SERVER['REQUEST_METHOD'] == 'POST')
- {
- if(isset($_POST['name']))
- {
- if(!empty($_POST['name']))
- {
- $name = $_POST['name'];
- $db = new PDO('mysql:host=127.0.0.1;dbname=website', 'root', '');
- $st = $db->prepare('INSERT INTO `people` (`names`) VALUES (:name)');
- $st->bindParam(':name', $name, PDO::PARAM_STR);
- $st->execute();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement