this may seem like a silly question and if it does it'll tell you one thing: i'm a newbie! anywho; i have a mysql table of articles listing articleID categoryID & articleTXT. my sql statement selects all and returns it in an array. here's my question; i'd like to display items by category on the page (not just one category that comes on a different page) and show say the last 5 articles per category. is there a way to say show category one and all it's corresponding articles or will i have to write as many sql queries as there are categories?
It may be slightly more advanced than this, but you may be looking for WHERE. This can be used like so: SELECT * FROM table WHERE categoryID=1
This displays information only if categoryID is one.
thanks for the response mordecai. unfortunately that's not what i'd like to do (if neccesary). i don't want to limit my data returned to just one category on the page i'd like to have all data regardless of category and then separate the data into separate variables dependant upon category #. i just didn't know if i had to run multiple sql_queries or if i could utilize just one.