function main(){
$result = mysql_query("SELECT books.min_img, books.id_book, authors.author
FROM authors, books_to_author, books
WHERE authors.id_author = books_to_author.id_author
AND books_to_author.id_book = books.id_book");
if(mysql_num_rows($result)>0)
{
while($myrow = mysql_fetch_array($result))
{
$main[$myrow[id_book]] = $myrow;
}
return $main;
}
else
{
echo"<p>The inquiry about sample of the data has not selected</p>";
exit(mysql_error());
}
}