<?php
$verbindung = mysql_connect ("1.1.1.28","x","y")
or die ("keine Verbindung möglich Benutzername oder Passwort sind falsch");
mysql_select_db("mis")
or die ("Die Datenbank existiert nicht.");
$title = $HTTP_POST_VARS["title"];
$year = $HTTP_POST_VARS["year"];
$edition = $HTTP_POST_VARS["edition"];
$author = $HTTP_POST_VARS["author"];
$eintrag = "INSERT INTO books_ge (title,year,edition) VALUES ('$title','$year','$edition')";
$eintragen = mysql_query($eintrag);
$eintrag2 = "INSERT INTO authors_ge (author) VALUES ('$author')";
$eintragen2 =mysql_query($eintrag2);
$eintrag3 = "INSERT INTO rel_book_author_ge (author_id,book_id) VALUES authors_ge (author_id), books_ge (book_id)";
$eintragen3 =mysql_query($eintrag3);
$abfrage = "SELECT books_ge.title,
books_ge.year,
books_ge.edition,
books_ge.book_id
FROM books_ge";
http://stunet01/
$ergebnis = mysql_query($abfrage)
or die ("Ungueltiges SQL".mysql_error());
while ($row = mysql_fetch_row($ergebnis))
{
echo "<tr><TD>$row[0]</TD><TD>$row[1]</TD><TD>$row[2]</td>";
$abfrage2 = "SELECT authors_ge.author
FROM authors_ge,
rel_book_author_ge
WHERE rel_book_author_ge.book_id=".$row[3]." and
authors_ge.author_id=rel_book_author_ge.author_id";
$ergebnis1 = mysql_query($abfrage2)
or die ("Ungueltiges SQL".mysql_error());
echo "<td>";
while ($row1= mysql_fetch_row($ergebnis1))
echo "$row1[0]<br>";
echo "</td></tr>";
}
?>