i have created books site and i have tables below:
- Books (author id is there in this table)
- authors_compile_rel (here is the id of compilers of the books)
now i want that if someone opens the author suppose (ahmed raza) so i want to display the books of this author if he wrote the books or even if he compiled the books.
compiled books and the author id is entered in authors_compile_rel table.
i have created the query below but it is not showing the compiled books by the author.
$auth_id = mysql_real_escape_string($_GET['id']);
$query = "
SELECT b.id, b.unique_name, b.native_name, b.auth_id, b.status, b.create_date, ar.auth_id FROM books b, authors_compile_rel ar
WHERE b.status = 1 AND b.auth_id = ".$auth_id." OR b.t_auth_id = ".$auth_id."
OR b.id = ".$auth_id." OR ar.auth_id = ".$auth_id."
ORDER by id DESC";