$user -> uid always return 1 I found on google that hook_menu() is cached, and I have to use a callback function, but I couldn't fix it. $user-&gt;uid is always 1. I don't know how to solve this problem.
I'm a beginner. Tnx.

function test_menu() {  
  $items = array();
  global $user;

  $nodde = db_query("SELECT title, nid, vid FROM {node} WHERE uid '$user-&gt;uid'")-&gt;fetchObject(); 

  $items['test'] = array(
    'title'            =&gt; t($nodde-&gt;title),
    'page callback'    =&gt; 'test_output',
    'access arguments' =&gt; array('access content'),
  );

  return $items;
}
As you suspect the results from hook_menu() invocations are cached. As you're only clearing the caches while logged in as user 1, that's why the logged in user is always user 1 for your router item.

To get around it you'll need to use a title callback, which is evaluated separately to the cached data:

function MYMODULE_menu() {
  $items['test'] = array(
    'title callback' =&gt; 'MYMODULE_title_callback',
    'page callback' =&gt; 'test_output',
    'access arguments' =&gt; array('access content')
  );

  return $items;
}

function MYMODULE_title_callback() {
  global $user;

  $args = array(':uid' =&gt; $user-&gt;uid);
  $node = db_query("SELECT title, nid, vid FROM {node} WHERE uid = :uid", $args)-&gt;fetchObject(); 

  return t($node-&gt;title);
} 


Also make sure you're not putting variables directly into the query string as this will leave you open to SQL injection attacks. You should use parameter replacement instead (as in the above example).