Thank you so much for the code. I'm trying to use 2 different tables. One for Males and the other one for Females. They both contain the same information (ID, gender, name, last name). How do I modify the code so that the output will have all the Males in one table and the Females on another table? Sorry, I'm a php noob. Any help will be greatly appreciated.