PDA

View Full Version : Content Type Id


Ldoppea
02-14-2010, 03:39 PM
Hi,

I'm trying to get the extension of a defined attachement on the DB.

On vB3, I used :

SELECT attachmentid, userid, dateline, contentid, extension
FROM vb4_attachment
WHERE extension IN ('jpeg', 'jpg', 'png');


But on vB4, there isn't 'extension' field anymore. There is a 'contenttypeid' field in 'vb4_attachment' table and an 'extension' field in 'vb4_attachmenttype' table, and I didn't find any link between these fields.

Can you help me? Thanks

PS : Is there any diagram of the database somewhere?

Paul M
02-14-2010, 04:26 PM
In attachments you will find a field called filedataid - this links you to the relevant record in te filedata table, the extension is one of the fields in this table.

Ldoppea
03-11-2010, 08:08 AM
Ok it works, thanks ;)