hi i have product A and B
A have
Aid
price
date
isbn
B have
Aid
price
date
album
i want to select them in one place i want just id,price and date
how can i query this!!??? thank you
hi i have product A and B
A have
Aid
price
date
isbn
B have
Aid
price
date
album
i want to select them in one place i want just id,price and date
how can i query this!!??? thank you
Does this help you?
Red: Field in table1.Code:$query ="SELECT table1.field1, table2.field2 FROM table1, table2 WHERE table1.field1=table2.field2";
Navy: Field in table2.
LightGray: Table1.
DarkGray: Table2.
You can get a bit more info on that here: http://www.w3schools.com/sql/sql_join.asp
I hope this helps,
Nile
Jeremy | jfein.net
I'm sorry dude but table 1 and table 2 it doesn't have any relationship
ok table 1 is Book product and table 2 is cd product right and i want to view it at once in same list i build and the information that 2 table have the is price and title for example
so if i list it all when i click it it will go to product's page so that's mean book_id and cd_id is not the same right? do i miss anyhting
i have
table of product A
- Aid
- Price
- Adetail
table of product B
- Bid
- Price
- Bdetail
2 of these table r not have any relationship
how can i view this 2 tables in one query
how can i do that???
http://dev.mysql.com/doc/refman/5.0/en/union.htmlCode:SELECT f1, f2 FROM t1 WHERE f1='foo' UNION(SELECT f3, f4 FROM t2 WHERE f3='foo')
Bookmarks