Undefined variable Error when try to access PHP class variable in function
<p>I have run into a problem. My php class structure is as follows:</p>

<pre><code>    class CustomerDao{
...
var $lastid;

  function insertUser($user)
  {
    ...
    $lastid = mysql_insert_id();
    return 0;
  }
      function getCustId()
  { 
    return $lastid; 
  }
    }
</code></pre>

<p>When i use this class, it let me access $lastid varibale in first function "insertUser", but it throws an error when i use $lastid in second function. I have no idea how to resolve this problem. Please guide.</p>
