Log in

View Full Version : SQL-Query to put content in categories.


GriZzm0
11-13-2006, 01:56 PM
I'm learning to create plugins. And I'm working on a plugin that should print out 6 categories from the databas.
$result = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "jobs WHERE act = 1");
Then the 6 categories should be filled with content.
$resultRequest = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "jobs WHERE act = 0 and category = '". $category['category'] ."' LIMIT 5");
The problem is that I have no idea how to make it print out the info inside the categories.
I would like to print it out like this.
+-----------------------+-----------------------+-----------------------+
| Category 1 | Category 2 | Category 3 |
+-----------------------+-----------------------+-----------------------+
| Content in | Content in | Content in |
| Category 1 | Category 2 | Category 3 |
+-----------------------+-----------------------+-----------------------+
| Category 4 | Category 5 | Category 6 |
+-----------------------+-----------------------+-----------------------+
| Content in | Content in | Content in |
| Category 4 | Category 5 | Category 6 |
+-----------------------+-----------------------+-----------------------+
Anyone have any idea on how to do that? :p