Answers for "php pdo insert query"

SQL
2

pdo mysql insert

<?php
$pdo = new PDO('mysql:host=localhost;dbname=test', 'username', 'password');
 
$statement = $pdo->prepare("INSERT INTO users (email, vorname, nachname) VALUES (?, ?, ?)");
$statement->execute(array('[email protected]', 'Klaus', 'Neumann'));   
?>
Posted by: Guest on December-08-2020
0

php pdo insert data to sql

  $sql = "INSERT INTO MyGuests (firstname, lastname, email)
  VALUES ('John', 'Doe', '[email protected]')";
  // use exec() because no results are returned
  $conn->exec($sql);
Posted by: Guest on October-28-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language