title: Should I instantiate new objects for all different interactions?
body: <p>Im having a hard time grasping this concepts of objects and how they should interact/exist.</p>
  
  <p>Should I for instance have different objects (well, maybee I mean connections to the database here if there is any difference) for interactions with my database whenever they are not related? </p>
  
  <p>Lets say I have one object that index.php uses to get and display content from the database 
  and another object that a user use to add/remove things in the database. We can say that the objects are all of the class dbinteract which holds all the functions for messing about with the database.</p>
  
  <p>Or should I maybee divide the classes into something like: dbconnection, dbdisplay, dbinsertion, dbmodification where I send the dbconnection to the other objects?</p>
  
  <p>I feel like im missing something very obvious and it's frustrating trying to move forward not knowing where in the thought process im going wrong, I guess im looking for a question as well as a an answer here.</p>
  
  <h2>index.php</h2>
  
  <pre><code>$connection = new dbconnection();
  $displayer = new dbdisplay();
  
  $activeconnection = $connection-&gt;connecttodatabase();
  $pagetodisplay = $connection-&gt;getcontentofpagetodisplay($query);
  $displayer-&gt;displayPage($activeconnection, $pagetodisplay);
  </code></pre>
  
  <h2>userinsert.php</h2>
  
  <pre><code>$inserter = new dbinsert();
  $usersdbconnection = new dbconnection();
  
  $inserter-&gt;newPost($userdbconnection, $usercredentials, $posttextfromuser);
  $usersdbconnection-&gt;closedatabaseconnection();
  </code></pre>