.load a php(mysql backend) in a DIV

.load a php(mysql backend) in a DIV

 I have an image map of a property plot, each lot is clickable to change the DIV content to backend.php.  Now my index.php file had the dBase connect script at the top as per usual, however the backend.php in the DIV will not connect to the dBase with the connection script JUST in the index, backend.php will not pull data without the connect script in it specificly.


   
  1. <HTML> <!-- index.php -->
  2. <?php SESSION_START(); INCLUDE "db_connect.inc"; ?>
  3. <HEAD>
index.php loads the lot.php by variables in the url, so index uses an INCLUDE
to put the lots.php page in it. The lots.php has a table with a simple DIV
       
  1.  <TD WIDTH="310" STYLE="background:url('img/lots_bg.png') no-repeat">
  2. <DIV ID="content">Phase 1 is currently under contruction</DIV>
  3. </TD>
My jquery that controls the click to change DIV is:
        
  1.  $(document).ready(function() {
  2. $("area").click(function() {
  3.  var prop = $(this).attr("href");
  4. $("#content").fadeOut("slow",function() {
  5.   $("#content").load("backend.php",{propid: prop});
  6. });
  7. $("#content").fadeIn("slow");
  8. return false;
  9.  });
  10. });
my backend.php that gets loaded after all this has to have the connection script
in it in order to work, why? has anyone run into this?
I don't want to have to have the connection script run twice on the same site on
the same page.
            
  1.  <?php
  2. INCLUDE "db_connect.inc";
  3. IF(isset($_POST['propid'])) {
  4. $pid = $_POST['propid'];
  5. $ph = substr($pid,2,1);
  6. $lt = substr($pid,-2,2);
  7. $getProp = "SELECT * FROM lots WHERE phase='$ph' AND lot='$lt'";
  8. $getProp_Q = mysql_query($getProp);
  9. $getProp_R = mysql_fetch_array($getProp_Q);

  10. ECHO "<H2>Phase ".$ph." | Lot # ".$lt."</H2>";
  11. }
  12. ?>
  13. <?php MYSQL_CLOSE($link); ?>