0

For Drupal 7, Field abc and field def both belong to same content type

$query = db_select('field_data_field_abc','ex')
  ->fields('ex', array('field_abc_value'));
$query->join('field_data_field_def', 'fsr', 'fsr.entity_id = ex.entity_id');
$query->addField('fsr', 'field_ort_target_id');
$query->join('node', 'n', 'ex.entity_id = n.nid');     
$query->addField('n','changed');
$query->addField('n', 'uid');
$result = $query->execute()->fetchAll() ;

In the above query how can I get the user uid and user name using relation between node uid and user uid. Bcoz. when I joined the users table , my results are empty

4
  • 2
    You can use (string) $query before execution to see the SQL that's being produced, that should help you identify what needs to be fixed
    – Clive
    Commented Sep 6, 2013 at 9:27
  • Have you tried to view the query executed using the "dpq" function of the devel module? Also posting the code/query for which you are getting this problme will help. Commented Sep 6, 2013 at 10:51
  • Usually there is an error message in server's error.log during WSODs. Please post it here.
    – Mołot
    Commented Sep 10, 2013 at 10:58
  • sorry but I dont get wsod but get a empty result when check the value of $result.
    – harshal
    Commented Sep 10, 2013 at 11:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.