Table IMAGES:
columns- imageID, Image, and categoryID*(this being the foreign key)
Table CATEGORIES:
columns categoryID, Category
and peform query for example:
$sql = "SELECT categoryID FROM IMAGES WHERE image = 'exampleImage'";
I would get the result as an integer of the category ID i.e 1
My question is what would be the query to display the category that the ID belongs to? Or any suggestions on how to work around with multiple queries.
You want to use an inner join so it returns the records that match based on the join criteria.