this is whati wrote but it gives me an T_ENCAPSED_AND_WHITESPACE in the second line, this is not the complete script but it's what matters.
this page calls itself in the second part. so first there is a search query that calls this page, it displays the results with a hyperlink that calls the page back ($PHP_SELF) with and added ?id=xx
basically the part that doesn't work is the first 4 or 5 lines, from if ($id) { to } else {
it won't put
printf("nombre: %s\n <br>", $myrow["autor"]); , because there is no id.
if ($id) {
$result = mysql_query("SELECT * FROM letras WHERE id = $_GET['id']");
$myrow = mysql_fetch_array(result,MYSQL_ASSOC) ;
printf("nombre: %s\n <br>", $myrow["autor"]);
} else {
$result = mysql_query("SELECT * FROM letras WHERE autor = \"" . $_POST['name'] . "\"");
if(!$result || !mysql_num_rows($result)) {
echo "<table width=\"100%\" border=\"0\" class='body'><tr><td>Query returned no results.</td></tr></table>";
} else {
print("<table width=\"100%\" border=\"0\" class='body'>");
print("<tr><td>Autor</td><td>Titulo</td><td>ID</td></tr>");
while($myrow = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf("<tr><td><a href=\"%s?id=%s\">%s</a></td><td>%s</td><td>%s</td></tr>\n", $PHP_SELF, $myrow['id'], $myrow['autor'], $myrow['titulo'], $myrow['id']);
}
echo "</table>";