Fatal error: Call to a member function fetch_row() on a non-object in line 49

I am already tired of trying all the possible variations of the code. If someone can help me I'd be glad!

Just to explain a bit: when first loads page, it loads all of the records from the db. And up until that point everything is ok. But, when I would click my search button with the filtering options, as is in the code for author and discipline, than the fatal error comes in.

Maybe I demand to much... But, still, will someone give me a resource or whatever where I can find a php code with mysqli for filtering input from a database. I have seen it working on million websites, and I cannot do it by myself. Depressive... It is simple: I have database that at the loading of the page loads all the records from the database. Than when I have some input in few select tags, I want to filter the input from the database, according to the inputs in the select tags...

It's not a question of filtering or whatever: you've written code that doesn't work because it tries to do two different things at the same time. You can't do a prepared statement with $stmt and all, not execute it, and then try to run the $sql as just a normal SQL statement.

To get it out of the way, move those final two lines of code into the else block - that's where they work best.

For mysqli_stmt you prepare (done), bind_param to send data in (done), execute, store_result to buffer the results locally for better performance, bind_result to get data out, fetch to get a row, then keep calling fetch as long as there are results.
What code did you try?

Does not return the fatal error... but still not getting the result... Namely, after the code above, I have a variable $rows that gives me feedback for the number of rows fetched from the query. But when the code from the if statement is executed nothing happens.

Probably because you changed the part of the code that I said was correct into something that is now incorrect.

1. Go back to what you had before
2. Change the variable you used with bind_result to be $row_indexed
3. Delete the while loop
4. Call fetch() once.

And one more thing: modify the code in the else branch so that it leaves the branch with $row_indexed being the number and not an array for the entire row.
The whole point of most of what I've been saying is to make it so that both halves of the if behave similarly: when either of them exits you have one particular variable with one particular value. $row_indexed being a number. No $count_articles, no arrays.