开发者

How to load Product from nid

开发者_如何学运维How Can I load a Product from the db based on the nid?


$product = db_fetch_object(db_query("SELECT * FROM {uc_products} WHERE nid = '%s'", *nid here*));

print_r($product);


Doing a direct db call is an option; however, it is not the Drupal way and does not utilize the benefits of fields, revisions, etc that Drupal's node/CCK system offers. Since uc_products are nodes in Drupal, simply call:

$product = node_load($nid);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜