Files
lpmj6/11/10.php
T
RobinNixon 0335342e00 First Draft
First Draft of the Example Files
2020-12-10 13:21:38 +00:00

20 lines
501 B
PHP

<?php
require_once 'login.php';
try
{
$pdo = new PDO($attr, $user, $pass, $opts);
}
catch (\PDOException $e)
{
throw new \PDOException($e->getMessage(), (int)$e->getCode());
}
$query = "INSERT INTO cats VALUES(NULL, 'Lion', 'Leo', 4)";
$result = $pdo->query($query);
$query = "INSERT INTO cats VALUES(NULL, 'Cougar', 'Growler', 2)";
$result = $pdo->query($query);
$query = "INSERT INTO cats VALUES(NULL, 'Cheetah', 'Charly', 3)";
$result = $pdo->query($query);
?>