继续Drupal分享精神 QQ群:107748121 站长QQ:2275288328 skype: hellodrupal【drupal交流+drupal 建站+theme制作】
登录 注册

Drupal 文件管理,数据库表的关系结构。files表,upload表,node

弄了半天,在block里面读取附件图片还没有弄好,不过drupal的附件表主要设计到三个表,files主要是是存储文件信息,然后
有upload这个表里的字段让node表和files表关系链接起来,也就是fid,nid。
可以用多表查询来读取附件,

<?php
SELECT u
.fid,f.filepath,n.title FROM {upload} u INNER JOIN {files} f ON u.fid = f.fid INNER JOIN {node} n ON n.nid = u.nid WHERE n.type ='product'
?>

补充:其中upload表,开启upload模块的时候,自动建立的。主要负责drupal附件的存储管理。

评论

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 自动断行和分段。
  • You can use BBCode tags in the text.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.