diff options
| -rw-r--r-- | Aufgabe04/catalog.sql | 128 | ||||
| -rw-r--r-- | Aufgabe04/index.html | 37 |
2 files changed, 165 insertions, 0 deletions
diff --git a/Aufgabe04/catalog.sql b/Aufgabe04/catalog.sql new file mode 100644 index 0000000..a149a4f --- /dev/null +++ b/Aufgabe04/catalog.sql @@ -0,0 +1,128 @@ +-- phpMyAdmin SQL Dump +-- version 4.4.1.1 +-- http://www.phpmyadmin.net +-- +-- Host: localhost +-- Erstellungszeit: 13. Apr 2015 um 11:33 +-- Server-Version: 10.0.17-MariaDB-log +-- PHP-Version: 5.6.7 + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; + +-- +-- Datenbank: `catalog` +-- + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `category` +-- + +CREATE TABLE IF NOT EXISTS `category` ( + `id` int(11) NOT NULL, + `name` varchar(100) NOT NULL, + `description` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `product` +-- + +CREATE TABLE IF NOT EXISTS `product` ( + `id` int(11) NOT NULL, + `name` varchar(100) NOT NULL, + `price` int(11) NOT NULL, + `width` int(11) NOT NULL, + `height` int(11) NOT NULL, + `description` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `product_category` +-- + +CREATE TABLE IF NOT EXISTS `product_category` ( + `product_id` int(11) NOT NULL, + `category_id` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Tabellenstruktur für Tabelle `user` +-- + +CREATE TABLE IF NOT EXISTS `user` ( + `username` varchar(100) NOT NULL, + `password` char(40) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Indizes der exportierten Tabellen +-- + +-- +-- Indizes für die Tabelle `category` +-- +ALTER TABLE `category` + ADD PRIMARY KEY (`id`); + +-- +-- Indizes für die Tabelle `product` +-- +ALTER TABLE `product` + ADD PRIMARY KEY (`id`); + +-- +-- Indizes für die Tabelle `product_category` +-- +ALTER TABLE `product_category` + ADD PRIMARY KEY (`product_id`,`category_id`), + ADD KEY `category_id` (`category_id`); + +-- +-- Indizes für die Tabelle `user` +-- +ALTER TABLE `user` + ADD PRIMARY KEY (`username`); + +-- +-- AUTO_INCREMENT für exportierte Tabellen +-- + +-- +-- AUTO_INCREMENT für Tabelle `category` +-- +ALTER TABLE `category` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; +-- +-- AUTO_INCREMENT für Tabelle `product` +-- +ALTER TABLE `product` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; +-- +-- Constraints der exportierten Tabellen +-- + +-- +-- Constraints der Tabelle `product_category` +-- +ALTER TABLE `product_category` + ADD CONSTRAINT `product_category_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `category` (`id`), + ADD CONSTRAINT `product_category_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`); + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/Aufgabe04/index.html b/Aufgabe04/index.html new file mode 100644 index 0000000..38dbccb --- /dev/null +++ b/Aufgabe04/index.html @@ -0,0 +1,37 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="UTF-8"> +<title>Manipulate Database</title> +</head> +<body> + <form action="http://www-in.fh-swf.de/fbp-cgi/showenv.pl" method="post"> + <h1>Product</h1> + Name: <input type="text" placeholder="Name" name="prod_name"><br> + Price: <input type="text" placeholder="Price" name="prod_price"><br> + Width: <input type="text" placeholder="Width" name="prod_width"><br> + Height: <input type="text" placeholder="Height" name="prod_height"><br> + Description: + <textarea placeholder="Description" name="prod_desc"></textarea> + <br> <input type="submit" value="Abschicken"> <input + type="reset" value="Zurücksetzen"> + </form> + + <form action="http://www-in.fh-swf.de/fbp-cgi/showenv.pl" method="post"> + <h1>Category</h1> + Name: <input type="text" placeholder="Name" name="cat_name"><br> + Description: + <textarea placeholder="Description" name="cat_desc"></textarea> + <br> <input type="submit" value="Abschicken"> <input + type="reset" value="Zurücksetzen"> + </form> + + <form action="http://www-in.fh-swf.de/fbp-cgi/showenv.pl" method="post"> + <h1>User</h1> + Username: <input type="text" placeholder="Name" name="user_username"><br> + Password: <input type="password" placeholder="Password" + name="user_password"><br> <input type="submit" + value="Abschicken"> <input type="reset" value="Zurücksetzen"> + </form> +</body> +</html>
\ No newline at end of file |
