asmith20002
03-27-2009, 11:28 AM
hi,
I have 2 tables.
The main is like
name img1 img2 img3
john 2 3 6
tom 5 6 2
jack 1 3 5
.
.
.
the second (img table)
id url
1 http...
2 http...
3 http...
.
.
.
I want to get all the data on the "main table".
and show like tabular data. but I need to get the image urls also.
If I use a simple join with 2 tables. it will give me more than 1 row for each user. for example the result will be like this :
name img1 img2 img3 id url
john 2 3 6 2 url(img2)
john 2 3 6 3 url(img3)
john 2 3 6 6 url(img6)
tom
.
.
.
I am wondering if there's any way to get them like this :
name img1 img2 img3 url1 url2 url3
john 2 3 6 url(img2) url(img3) url(img6)
tom 5 6 2 url(img5) url(img6) url(img2)
.
.
Is it possible?
Or any better way?
I have 2 tables.
The main is like
name img1 img2 img3
john 2 3 6
tom 5 6 2
jack 1 3 5
.
.
.
the second (img table)
id url
1 http...
2 http...
3 http...
.
.
.
I want to get all the data on the "main table".
and show like tabular data. but I need to get the image urls also.
If I use a simple join with 2 tables. it will give me more than 1 row for each user. for example the result will be like this :
name img1 img2 img3 id url
john 2 3 6 2 url(img2)
john 2 3 6 3 url(img3)
john 2 3 6 6 url(img6)
tom
.
.
.
I am wondering if there's any way to get them like this :
name img1 img2 img3 url1 url2 url3
john 2 3 6 url(img2) url(img3) url(img6)
tom 5 6 2 url(img5) url(img6) url(img2)
.
.
Is it possible?
Or any better way?