Re: help w/Multiple Joins

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi,

you have to create aliases for every column you want to fetch results from.
you have to change your query like this:
SELECT i1.img_path AS i1_path, i2.img_path AS i2_path, i3.....
you can leave out the "AS" if you want to..

hth, bastian

> $result = mysql_query("SELECT * FROM photo_album as p INNER JOIN images
> AS i1 ON p.img_1=i1.img_id
>         INNER JOIN images AS i2 ON p.img_2=i2.img_id
>         INNER JOIN images AS i3 ON p.img_3=i3.img_id
>         INNER JOIN images AS i4 ON p.img_4=i4.img_id",$db)or
> die(mysql_error());


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux