Hi, I have a photo album creation table. My code makes 1 insert for each image added in the photo album. I have a grid for displaying the albums for the user to view. I want to make a distinct of duplicate albums.
I have this type of code:
$select = Doctrine_Query::create()
->select('DISTINCT s.idAlbum')
->addSelect('s.imagens_data, s.publicar')
->from('tbimagens s')->getSqlQuery();
print_r($select);
die;
This is my result in Sql:
SELECT DISTINCT
t.id AS t__id,
t.idalbum AS t__idalbum,
t.imagens_data AS t__imagens_data,
t.publicar AS t__publicar
FROM tbimagens t
Have you seen that select carries the Id of the table? This Id is making me unable to make the correct select because all Ids are already naturally distinct.
Can anyone help me with this query? I am using symfony 1.4 and doctrine 1.2