The table names correspond to the photo categories. For example if it was the people category, the table name is "people". My plan was to name each photo category page the same name as the table, so that I could use the $_SERVER[SCRIPT_NAME] variable to select photos from that specific table.
Wrong way
would I need to make a single table and categorize all the entries by which photo category their in? For example would I have to make an extra row named photo_category and use the bind_param function to set the table name to the $_SERVER[SCRIPT_NAME] variable?
Essentially, is there any way to use bind_param to dynamically select a table, or would I have to change my database organization so that the bind_param could be used where an expression is expected?
The right way

Except that I don't know why you should use $_SERVER[SCRIPT_NAME] - elaborate, please.
Probably, you will have to categorize one picture into multiple categories. So, I would advice you not to put an extra field "photo_category" (because this way you can assign only one category per picture), but to create three tables:
Code: Select all
picture : id, name, file_name, etc ...
category: id, name, etc ...
category_picture: FK_picture_id, FK_category_id
So, you could create several
category_picture records per picture, this way assigning several categories to a picture.