Jump to content


Photo

Data not refreshing on page


  • Please log in to reply
No replies to this topic

#1 mdub2112

mdub2112
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 19 October 2006 - 09:08 PM

First off - NEWBIE here
So, where can I find that newbie help forum??

Now, this is all running on a lamp server
I've tested w\ both IE and FF and results are same

Writer uploads a file (to folder) gives it a title and places it in a category
Then publishes the, oh I'll call it a post

The dbase holds column names of sop, category (or these are the ones I'm havin' trouble with)
Everything seemed to be working fine

Output was expected

Category 1
  Test 1 Cat 1
Category 2
  Test 1 Cat 2
Category 3
  Test 1 Cat 3

Then I tested the whole thing by adding another 'post' in to a couple of the categories
I was hoping for

Category 1
  Test 1 Cat 1
  Test 2 Cat 1
Category 2
  Test 1 Cat 2
  Test 2 Cat 2
Category 3
  Test 1 Cat 3
  Test 2 Cat 3

It seems that either the category is not showing the newly added "Test 2 Cat #" or it is kicking out the "Test 1 Cat #" and replacing it with "Test 2 Cat #  Such as

Category 1
  Test 2 Cat 1
Category 2
  Test 2 Cat 2
Category 3
  Test 1 Cat 3


Not sure what info you might need other than the code I'm using

<?php
  include_once('db_grab.php');

  $handle = db_connect();

  $categories_sql = 'select * from categories order by code';
  $categories_result = $handle->query($categories_sql);
 
  while ($categories = $categories_result->fetch_assoc())
  {
    $sop_sql = "select * from sops
                  where category = '{$categories['code']}'
                  and published is not null
                  order by published desc";
 
    $sop_result = $handle->query($sop_sql);
   
    if ($sop_result->num_rows)
    {
      $sop = $sop_result->fetch_assoc();
      echo "<p class='head'>{$categories['description']}</p>
              <p><a href='{$sop['pdf_file']}' target='_blank'>
                {$sop['title']}
                </a>
              </p>";
}
  }
?>


If I change the $sop_sql query to order by title asc (to which I'd prefer) then all categories simply revert back to the first postings
Any help greatly appreciated




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users