attribute image FileID sometimes returns 0

Permalink
Hello,

with the following database query i select active pages

SELECT cID FROM Pages WHERE (cID > 1) AND (cIsActive=1) AND (cIsSystemPage=0) AND (cIsTemplate=0) ORDER BY cID


then i filter out the pages i need with the pagetype and with the following code i retrieve the fileID of an image attribute
$wsArtAfbeeldingsFile = $cobj->getAttribute('artAfbeelding');
$wsArtAfbeelding = $wsArtAfbeeldingsFile->getFileID();


then i insert this and other data into a table.

The problem is that some (not all) of the rows in my table give me a '0' (zero) for the fileID and i am certain every page has that image attribute.

what am i missing or doing wrong?

thank you

gr

Marco

stmarco
 
stmarco replied on at Permalink Reply
stmarco
Sometimes you need to let a problem rest for a few days and you find the answer to it. I forgot i made the query twice depending on the situation, in the second query i forgot to insert the fileID so it got a 0

st****d me!!!

case closed