There is no error message. If I run the query in phpMyAdmin, I can see the number of seconds to complete the query increase as I add more tables. When I join around 20 tables, phpMyAdmin stops responding, and the database must be deleted and restored from a backup file.
I am using a shared hosting service,
http://www.ntchosting.com/elearning-web-hosting.html. The php configuration is shown at
http://www.thewordmap.com/phpinfo.php My understanding is that the query which is failing is an explicit join.
I can retrieve the data using two separate queries. However, this complicates the task of creating a homework reporting component, and results in a less useful tool because teachers would have to manually combine the information displayed.