Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

PDO insert query

$stmt = $conn->prepare("INSERT INTO MyGuests (firstname, lastname, email)
VALUES (:firstname, :lastname, :email)");
$stmt->bindParam(':firstname', $firstname);
$stmt->bindParam(':lastname', $lastname);
$stmt->bindParam(':email', $email);

// insert a row
$firstname = "John";
$lastname = "Doe";
$email = "john@example.com";
$stmt->execute();
Source by www.phptutorial.net #
 
PREVIOUS NEXT
Tagged: #PDO #insert #query
ADD COMMENT
Topic
Name
1+6 =