0335342e00
First Draft of the Example Files
18 lines
358 B
PHP
18 lines
358 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, 'Lynx', 'Stumpy', 5)";
|
|
$result = $pdo->query($query);
|
|
|
|
echo "The Insert ID was: " . $pdo->lastInsertId();
|
|
?>
|