Jump to content

query help


ccrevcypsys

Recommended Posts

Heres the problem. I need to pull a list of albums with the album information. But i cant seem to word it right. So it is pulling out a list of all the songs like this

songs.jpg

c how those are all the same album. I need that to only be one album listing so the onlything that would be on there is one row. how would i fix this??

$productListQuery = "SELECT i.*,a.*,c.*  FROM ".$glob['dbprefix']."albums a
					 LEFT JOIN ".$glob['dbprefix']."customer c
					 ON c.customer_id = a.artist_id
					 JOIN ".$glob['dbprefix']."inventory i
					 ON i.album_id = a.album_id
					 WHERE i.album_id = a.album_id ORDER BY a.album_id";

 

and here is my database table.

 

|------songs-------|        |------albums------|      |------customer-----|

    song_id                +----      album_id          +------  customer_id

    name                  |            artist_id--------+          other_info

    album_id    -------+

    other_info   

 

Link to comment
Share on other sites

ok well then i have made it like this

$productListQuery = "SELECT 
					 a.artist_id, a.album_id,
					 i.image, i.albumName, i.album_id,
					 c.screenname, c.customer_id
					 FROM ".$glob['dbprefix']."StreamRush_albums a
					 INNER JOIN ".$glob['dbprefix']."StreamRush_customer c
					 INNER JOIN ".$glob['dbprefix']."StreamRush_inventory i
					 ORDER BY a.album_id";

 

and now it returns with 281 pages of the same information...

Link to comment
Share on other sites

Guest
This topic is now 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.