Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2009
    Posts
    152
    Thanks
    8
    Thanked 0 Times in 0 Posts

    how to output it?

    the print_r($a)'s result is



    views_handle_field_node Object

    (

    [view]=>view Object

    (
    [db_table] => views_view
    [base_table] => node
    [args] => Array
    (
    [0] => My entry 1
    )

    [use_ajax] =>
    [result] => Array
    (
    [0] => stdClass Object
    (
    [nid] => 5
    [node_title] => Title of a test entry
    [node_revisions_body] =>
    [node_revisions_format] => 1
    [node_vid] => 5
    [term_data_name] => My first test term name
    [term_data_vid] => 1
    [term_data_tid] => 1
    [vocabulary_name] => Vocabulary 1
    [node_revisions_vid] => 5
    )

    [1]=> stdClass Object
    (
    [nid] => 8
    [node_title] => Title of a test entry
    [node_revisions_body] =>
    [node_revisions_format] => 1
    [node_vid] => 5
    [term_data_name] => My first test term name
    [term_data_vid] => 1
    [term_data_tid] => 1
    [vocabulary_name] => Vocabulary 1
    [node_revisions_vid] => 5
    ..
    [2]..
    ..



    now i want to output the [nid]=>5 and[nid]=>8.....and all the nid's value.i use this, but can't work.

    $views_handle_field_node->$view->$result[]->nid. what's the correct output of it.

  • #2
    Super Moderator
    Join Date
    Feb 2009
    Location
    England
    Posts
    539
    Thanks
    8
    Thanked 63 Times in 54 Posts
    PHP Code:
    foreach($views_handle_field_node->view->result as $node) {
      echo(
    $node->nid."\n");

    lamped.co.uk :: Design, Development & Hosting
    marcgray.co.uk :: Technical blog


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •