Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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) :)