// show titles elseif($sqlType=="title") { // just in case it is still here: drop tmpTitleIDs mysql_query("DROP TABLE IF EXISTS tmpTitleIDs"); // create new table with title IDs mysql_query($sql); echo $sql or die(mysql_error()); if(!mysql_affected_rows()) { echo "

No results.\n"; } else { // querys for complete title data $result1 = mysql_query ("SELECT titles.titleID AS titleID, " . " titles.title AS title, " . " titles.subtitle AS subtitle, " . " titles.edition AS edition, " . " titles.year, " . " titles.isbn, " . " titles.comment, " . " publishers.publName AS publisher, " . " publishers.publID, " . " categories.catName AS category, " . " languages.langName AS language " . " FROM titles JOIN tmpTitleIDs" . " LEFT JOIN categories ON titles.catID = categories.catID " . " LEFT JOIN languages ON titles.langID = languages.langID " . " LEFT JOIN publishers ON titles.publID = publishers.publID " . "WHERE titles.titleID = tmpTitleIDs.titleID" ); // query for authors $result2 = mysql_query ("SELECT tmpTitleIDs.titleID, rel_title_author.authID, " . " authName AS author " . "FROM authors, rel_title_author, tmpTitleIDs " . "WHERE authors.authID = rel_title_author.authID " . " AND rel_title_author.titleID = tmpTitleIDs.titleID " . "ORDER BY rel_title_author.authNr, authName"); // Query for standort $result3 = mysql_query (" SELECT standort.name from standort," . "WHERE titles.standortID = standort.standortID");////<-DA STIMMT WAS NICHT // copy authors into array while($row = mysql_fetch_object($result2)) { // seperate authors by a comma if($authors[$row->titleID]) $authors[$row->titleID] .= ", "; // add author to author's list; because of ORDER BY clause // in the SQL statement the authors are ordered correctly $tmp = build_href("./find.php", "sqlType=title&authID=$row->authID", last_name_last($row->author)); $authors[$row->titleID] .= $tmp; } echo '

'; //testzeile // show title list echo "