title: insert data from a class into a database using PHP
body: <p>I don't understand this at all.</p>
  
  <p>I have a class which is roughly the following:</p>
  
  <pre><code>&lt;?php
  class pageData
  {
      private $Bookmark;
      private $Program;
      private $Agency;
  
      //With appropriate setters/getters
  }
  ?&gt;
  </code></pre>
  
  <p>Then I try to create a new object, pass it around a bit, and eventually end up with:</p>
  
  <pre><code>mysql_query("INSERT INTO Records (Bookmark, Program, Agency)
  VALUES ('$data-&gt;getBookmark()', '$data-&gt;getProgram()', '$data-&gt;getAgency()')");
  </code></pre>
  
  <p>I end up with <strong>Notice</strong>: Undefined property: pageData::$getBookmark in...</p>
  
  <p><strong>Notice</strong>: Undefined property: pageData::$getProgram in...</p>
  
  <p><strong>Notice</strong>: Undefined property: pageData::$getAgency in...</p>
  
  <p>Using PhpMyAdmin it looks like Bookmark becomes 0 and Program becomes () and Agency is empty.</p>
  
  <p>If I type</p>
  
  <pre><code>print($data-&gt;getBookmark());
  </code></pre>
  
  <p>it prints out the bookmark. if I type</p>
  
  <pre><code>echo $data-&gt;getBookmark();
  </code></pre>
  
  <p>it prints out. Why doesn't it work when I try to insert it into the database, too?</p>