Antivirus
06-10-2006, 12:06 PM
I have a query which works fine returning all my data using following method:
$sql = "
SELECT erc_artist.*, erc_artisttype.artisttype, MIN(erc_artistimage.artistimageid) AS artistimageid
FROM erc_artist
LEFT JOIN erc_artisttype ON erc_artist.artisttypeid = erc_artisttype.artisttypeid
LEFT JOIN erc_artistimage ON erc_artist.artistid = erc_artistimage.artistid
WHERE artistisactive = '1'
GROUP BY erc_artisttype.displayorder, artisttitle
";
But when i try to use the following $db->query_first method i get nada!
$sql = $db->query_first("
SELECT erc_artist.*, erc_artisttype.artisttype, MIN(erc_artistimage.artistimageid) AS artistimageid
FROM erc_artist
LEFT JOIN erc_artisttype ON erc_artist.artisttypeid = erc.artisttype.artisttypeid
LEFT JOIN erc_artistimage ON erc_artist.artistid = erc_artistimage.artistid
WHERE artistisactive = '1' AND erc_artistimage.image_type = 'artistpicture'
GROUP BY erc_artisttype.displayorder, artisttitle
");
Does anyone know what i am doing wrong here?
$sql = "
SELECT erc_artist.*, erc_artisttype.artisttype, MIN(erc_artistimage.artistimageid) AS artistimageid
FROM erc_artist
LEFT JOIN erc_artisttype ON erc_artist.artisttypeid = erc_artisttype.artisttypeid
LEFT JOIN erc_artistimage ON erc_artist.artistid = erc_artistimage.artistid
WHERE artistisactive = '1'
GROUP BY erc_artisttype.displayorder, artisttitle
";
But when i try to use the following $db->query_first method i get nada!
$sql = $db->query_first("
SELECT erc_artist.*, erc_artisttype.artisttype, MIN(erc_artistimage.artistimageid) AS artistimageid
FROM erc_artist
LEFT JOIN erc_artisttype ON erc_artist.artisttypeid = erc.artisttype.artisttypeid
LEFT JOIN erc_artistimage ON erc_artist.artistid = erc_artistimage.artistid
WHERE artistisactive = '1' AND erc_artistimage.image_type = 'artistpicture'
GROUP BY erc_artisttype.displayorder, artisttitle
");
Does anyone know what i am doing wrong here?