title: PHP Gallery Problem
body: <p>Ok, I have a gallery that's being populated by a database but for some reason it's not pulling entries from beyond May 31st 2011. I've scoured the code and can't find any date limitations so I'm at a loss as to why it's not pulling in any recent entries.</p>
  
  <p>I've also looked through the database table and don't see any irregularities between pre May31st and more current entries.</p>
  
  <pre><code>&lt;?php
  //GALLERY PAGE
  $user="USER";
  $password = "PASSWORD";
  $database = "GALLERY";
  $hostname_portfolio ="localhost:3306";
  
  //gets the page number from the URL
  
  if($_GET["pageNum"]==''){
  $listedNum=0;
  
  //gets the page limit from the URL
  $limit=5;
  }
  
  else{
  $listedNum=$_GET["pageNum"];
  
  //gets the page limit from the URL
  $limit=$_GET["limit"];
  
  }
  //creates the list of projects and puts them into an array
  $project= array();
  
  $con = mysql_connect($hostname_portfolio,$user,$password);
  if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
  
  $dbcon = mysql_select_db("GALLERY", $con);
  if (!$dbcon)
    {
    die('Could not connect: ' . mysql_error());
    }
    if ($dbcon)
    {
    }
  
   mysql_select_db($database, $con);
  
  $result = mysql_query("SELECT * FROM Persons ORDER BY date_uploaded DESC");
  
  
    echo"&lt;div class='clear' style='clear:both;'&gt;&lt;/div&gt;";
  
  $j=0;
  do{
    if($row['approved']=="true"){
      $project[$j] = 
          "&lt;div class='project-list'&gt;
              &lt;div class='user-project'&gt;
                  &lt;div class='container'&gt;
                      &lt;div class='before-box' &gt;
                          &lt;p class='picture_state'&gt;Before&lt;/p&gt;
                          &lt;a href='http://THEURL.com/". $row['image_path']."'&gt;
                          &lt;img src= '". $row['image_path']. "' width='400px' height='300px'/&gt;&lt;/a&gt;
                          &lt;br /&gt;
                      &lt;/div&gt;
                      &lt;div class='after-box'&gt;
                          &lt;p class='picture_state'&gt;After&lt;/p&gt;
                          &lt;a href='". $row['picture_state']."'&gt;
                          &lt;img src= '". $row['picture_state']. "' width='400px' height='300px' /&gt;&lt;/a&gt;
                          &lt;br /&gt;
                      &lt;/div&gt;
                      &lt;div class='sidebox'&gt;
                          &lt;div class='inner-sidebox'&gt;
                              &lt;p class='date-project'&gt;
                                  Submitted by " . $row['FirstName'] . " " . $row['LastName']. " on " .$row['date_uploaded']. "&lt;/p&gt;
                              &lt;p&gt; " .$row['decription']. "&lt;/p&gt;";
              if($row['ATTR1'] || $row['ATTR2']){ 
                  $project[$j] .= "&lt;p&gt;Used "; 
                  if ($row['ATTR1']){ 
                      $project[$j] .= "PRODUCT2&amp;trade;"; 
                      if ($row['color1']){ 
                          $project[$j] .= " in " . $row['color1']; 
                      }
                      if ($row['ATTR2']){
                          $project[$j] .= " and ";  
                      }   
                  }
                  if($row['ATTR2']){ 
                      $project[$j] .= "PRODUCT&lt;sup&gt;&amp;reg;&lt;/sup&gt;"; 
                      if ($row['color2']){ 
                          $project[$j] .= " in " . $row['color2']; 
                      }
                  }
                  $project[$j] .= "&lt;/p&gt;"; 
              }
              $project[$j] .= "
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class='clear' style='clear:both;'&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class='clear' style='clear:both;'&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class='clear' style='clear:both;'&gt;
          &lt;/div&gt;";
          $j++; 
  }
  
  }
  
  while($row = mysql_fetch_array($result));
  
  $max=sizeof($project);
  
  for($i=$listedNum;$i&lt;$limit;$i++){
  
  echo $project[$i];
  
  }
  
  
  $max=sizeof($project) - 1;
  
  echo "&lt;div class='bottom' style='width:170px;margin:0px auto;'&gt;";
  
  if($listedNum &gt; 0){
      $prevPageNum=$listedNum - 5;
      $lastPage= $limit - 5;
      echo "&lt;a href='http://THEURL.com/gallery.php?    pageNum=".$prevPageNum."&amp;limit=".$lastPage."'&gt;&lt; Last Page &lt;/a&gt;";   
  }
  else{
  $prevPageNum=$listedNum;
  $lastPage= $limit;
  }
  echo"&amp;nbsp;&amp;nbsp;";
  if($limit &lt;= $max){
  
  $newPageNum=$listedNum + 5;
  $nextPage= $limit + 5;
  echo "&lt;a href='http://THEURL.com/gallery.php?pageNum=".$newPageNum."&amp;limit=".$nextPage."'&gt; Next Page &gt;&lt;/a&gt;";    
  
  }
  
  else{
      $newPageNum=$listedNum;
      $nextPage= $limit;
  }
  
  echo "&lt;/div&gt;";
  
  mysql_close($con);
  ?&gt; 
  </code></pre>