mdub2112 Posted October 19, 2006 Share Posted October 19, 2006 First off - NEWBIE hereSo, where can I find that newbie help forum??Now, this is all running on a lamp serverI've tested w\ both IE and FF and results are sameWriter uploads a file (to folder) gives it a title and places it in a categoryThen publishes the, oh I'll call it a postThe dbase holds column names of sop, category (or these are the ones I'm havin' trouble with)Everything seemed to be working fineOutput was expected[b]Category 1[/b] Test 1 Cat 1[b]Category 2[/b] Test 1 Cat 2[b]Category 3[/b] Test 1 Cat 3Then I tested the whole thing by adding another 'post' in to a couple of the categoriesI was hoping for[b]Category 1[/b] Test 1 Cat 1 Test 2 Cat 1[b]Category 2[/b] Test 1 Cat 2 Test 2 Cat 2[b]Category 3[/b] Test 1 Cat 3 Test 2 Cat 3It 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[b]Category 1[/b] Test 2 Cat 1[b]Category 2[/b] Test 2 Cat 2[b]Category 3[/b] Test 1 Cat 3Not 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 postingsAny help greatly appreciated Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.