![]() |
Sergey Kornilov admin 12/11/2014 |
Sure, you can use 'View as' type Custom for this purpose. Assuming that field name is AuthorId is both Authors and Books table here is the code you can use: $value = "<a href=books_list.php?(AuthorId~equals~".$data["AuthorId"].")>Books by this author</a>"; |
M
|
muhtar author 12/12/2014 |
Sure, you can use 'View as' type Custom for this purpose. Assuming that field name is AuthorId is both Authors and Books table here is the code you can use: $value = "<a href=books_list.php?(AuthorId~equals~".$data["AuthorId"].")>Books by this author</a>";
|
A
|
Anapolis 12/13/2014 |
After inserting this code, AuthorId begins to show "Books by this auhor" for all authors, and it does not filter the appropriate entries. I would like to keep authors' names as long as they are clickable. If I could run a code provided by you, I intend to use it for other columns such as series, tag etc. I am not so good at databases, so may be I did something wrong.
|
M
|
muhtar author 12/15/2014 |
You are leaving out important information. 1rst question: I presume you have a table perhaps called 'titles' with row after row of book titles and in a different column called 'AuthorId' of this table you have the same number that is called "AuthorId" in the 'authors' table? Do you have 2 tables that are related to each because they have a column called 'AuthorId'? One table is all Author names and their assigned AuthorId number. The other table is all those 'titles' with the AuthorId column filled with the same number, once in the Authors table, and multiple times in the 'titles' table. So that when AuthorId 5 is selected that the query says something like "Select titles WHERE 'titles'.'AuthorId' = 5 SORT BY 'titles' " or maybe "Select titles WHERE AuthorId = '5' "
|
![]() |
Sergey Kornilov admin 12/15/2014 |
But this exactly what code I provided does. |