I am new to PHP programming and I need someone help now. I have 2 tables. In table 2 I have image links stored like
id image URL order
12345 www.abc.com/xxx.jpg 0
12345 www.abc.com/yyy.jpg 1
12346 www.abc.com/zzz.jpg 0
12346 www.abc.com/aaa.jpg 1
12346 www.abc.com/vvv.jpg 2
12346 www.abc.com/333.jpg 3
12347 www.abc.com/vvf.jpg 0
12347 www.abc.com/111.jpg 1
In table 1
id name
12345 something1
12346 something2
12347 something3
.
.
I have to load the data after LEFT JOIN with table 1 with key Id. Assume table1 have 7 variables too.the output I need is
id name(table1) img1(oforder0) img2(oforder1) img3(of order2) img4(oforder3)
12345 something1 www.abc.com/xxx.jpg www.abc.com/yyy.jpg - -
12346 something2 www.abc.com/zzz.jpg www.abc.com/aaa.jpg www.abc.com/vvv.jpg www.abc.com/333.jpg
12347 something 3 www.abc.com/vvf.jpg www.abc.com/111.jpg - -
is it possible to do first of all? All I have tried until now is put for loop for image names & using Where order='$i' and create own variables and that’s doesn’t seems to work.
Because I don’t want the id and name field repeat again and again.I need someone help here to choose the right way to get the URL in the same row(if it is possible)
id, though you may have more?