Well since we have no idea what you are trying to accomplish we can just make guesses.
My guess for your first construction (where you say you got blank pages) is that your query turned out to be empty.
Now if you know that column a_id in art has at least one record with what is inside $a_id then we have a different problem.
For you second problem, a_id=$a_id will only work as expected for numerical values in $a_id and where a_id is a numerical type in the table. For columns of string type you need to enclose the compare to string, i.e a_id='thisString' and when used with a variable you end up with a_id='$a_id' for example.
I don't know what the error
"not a valid source" error:
means and exactly where you are getting it.
I am sure others here knows it.