adjust access data) $db_hostName = "localhost"; // (--> adjust me) $db_userName = "user"; // (--> adjust me) $db_password = "pw"; // (--> adjust me) $db_databaseName = "db_name"; // (--> adjust me) @mysql_connect($db_hostName, $db_userName, $db_password) OR die(mysql_error()); mysql_select_db($db_databaseName); // Escape and convert input $artist = mysql_real_escape_string($_GET{'artist'}); $title = mysql_real_escape_string($_GET{'title'}); // Generating Query // (--> adjust columnnames) $query = ""; if ($artist !== "") { $query .= "MATCH (artist) AGAINST ('$artist') AND "; // (--> adjust me) } if ($title !== "") { $query .= "MATCH (title) AGAINST ('$title') AND "; // (--> adjust me) } if ($type !== "all") { $query .= "type = '$type' AND "; // (--> adjust me) } $query .= "1"; // Query // (--> adjust columnnames) $result = mysql_query("SELECT artist, title, type, url FROM texts WHERE $query ORDER BY artist, title LIMIT 50"); // (--> adjust me) // Fetch results and print to output if ($result) { while ($data = mysql_fetch_array($result)) { // Add language for Translations // (--> translation handling, remove if there can be no transaltions) if ($data[2] === "translation") { // (--> adjust me) $data[2] = "translation_de"; // (--> adjust me) } // Convert | --> __line__ in artist and title $data[0] = preg_replace("/\|/","__line__",$data[0]); $data[1] = preg_replace("/\|/","__line__",$data[1]); // (--> adjust type and url creation ) echo $data[0]."|".$data[1]."|".$data[2]."|http://lyric.tld/texts/".$data[3]."\n"; // (--> adjust me) } } ?>