Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP

PHP Make post go to specific column in database

Hi, i have a website i'm making for a customer and i have two categories. Now the thing is, i made a function in php where the admins can add categories. Where they go into the categories.php and add the category they want and that get's added as an column in a database table i made called categories. Now this is a social site where i wan't people to make their own posts kinda like Facebook. Now i want to make some code that make's the posts go straight to the second category they made. It won't change! How should i do this?

Sue Dough
Sue Dough
35,800 Points

Mike its extremely hard to answer this without code and a database schema. My advice is take a step back and first write down the proper mysql query without PHP and run it in mysql. Once it works then make it into PHP code.

Sue i figured out it would be a lot easier to just make two static pages and then make some SQL code that would show posts from there. One thing though is that i need to make a like system which is hard because i can't really find any good tutorials on it, but i'm probably gonna figure it out (i hope) :)