Answers for "insert form value into database php"

PHP
1

insert form value into database php

/* PDO Class to connect to the database*/
/* Make sure you add the connect file which has the variable $connect */
$name 	  = $_POST["name"];
$password = $_POST["password"];
$stmt = $connect->prepare("INSERT INTO tablename(name, password) VALUES(:name, :pass)");
$stmt->execute(array(
  "name" => $name,
  "pass" => $password
));
/* 
  Check how to connect to the db using PDO 
  Type in google search: php how to connect to db using PDO
  you will find the answer for this question posted by me
*/
Posted by: Guest on June-14-2021

Code answers related to "insert form value into database php"

Browse Popular Code Answers by Language