Jump to content

combining multiple tables into one


mendoz

Recommended Posts

Hey freaks.

So here it goes.
I have a site with 5 categories(pcs,laptops...).
Normally I would create 5 tables for each category and then use:
"[color=green]SELECT * from '$table' WHERE id='$id'[/color]" or something like that.

So now I want to use a single table. How I get the correct line of the correct category.
For example: Get line number three from all the lines where type=laptop.

This can't be to hard for you guys,
I hope you're up for the "challange"...  :o
Link to comment
https://forums.phpfreaks.com/topic/30351-combining-multiple-tables-into-one/
Share on other sites

I only have 1 table containing different product categories:

| product id | category |
------------------------
|      1      |  laptops  |
|      2      |  cooling  |
|      3      |    pc's  |
|      4      |  laptops  |
|      5      |    pc's  |
------------------------

I want to get all the laptops and sort them like this: 1,2...
So I could use them with loops and stuff.

Any idea?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.