Show sourcecode
The following files exists in this folder. Click to view.
webbsrvprg/exercises/sql-intro/sql-intro3/
create-car.php
createtable.php
insertgarage-owner.php
sql-intro3-index.php
sql-intro3a.php
sql-intro3b.php
sql-intro3c.php
sql-intro3d.php
insertgarage-owner.php
38 lines ASCII Windows (CRLF)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
include ('../../../dbconnection.php');
try {
$sql = "INSERT INTO garage (name)
VALUES ('CoolGarage')";
$dbconn->exec($sql);
$sql = "INSERT INTO garage (name)
VALUES ('SmallGarage')";
$dbconn->exec($sql);
$sql = "INSERT INTO owner (name)
VALUES ('David')";
$dbconn->exec($sql);
$sql = "INSERT INTO owner (name)
VALUES ('Noah')";
$dbconn->exec($sql);
echo"Data skapad";
}
catch(PDOException $e) {
echo $sql . "<br />" . $e->getMessage();
}
$dbconn = null;
?>
</body>
</html>