I have a content type called user registration under this one cck field called regid. i would like to fetch the entered values of this particular field through programmatically probably by using dbquery() functions and print it. Anyone guide me how to achieve it.
1 Answer
Here is a little example, how to make requests in Drupal 6. You may change table name and field name and it should work for you.
$query = db_query('SELECT n.nid, regid.regid_FIELD_VALUE
FROM {node} AS n
JOIN {regid_FEILD_TABLE_NAME} AS regid ON regid.vid = n.vid
WHERE n.type = %s AND n.status = %d, $your_node_type, 1);
$result = array();
while($node_data = db_fetch_object($query)) {
$result[] = array(
'nid' => $node_data->nid,
'regid' => $node_data->regid_FIELD_VALUE,
);
}
-
Can you please guide me how to done the same thing in drupal 7.– sriniCommented Jul 27, 2015 at 4:51
-