We had to use the filepath instead of fid more then once,
Here is a small function we wrote, returning the filepath from the fid
/** * Get filepath by fid */
function filepath($fid) {
if (is_numeric($fid)) {
$filepath = db_fetch_object(db_query("SELECT filepath FROM files WHERE fid = '%s'", $fid));
if (is_string($filepath->filepath))
return $filepath->filepath;
else return FALSE;
} else return FALSE;
}
<p>
Liked it? have a Question on it?
Write a comment
The Devart Team










