The info that is produced now is the menu system for the site. When it displays now, (see
www.refrazegame.com) the main headings are in white and the subcategories are a yellow. Body of text is black. I was able to do that much applying some CSS to the pages. The person who coded the pages, used the html code to insert spaces. I want this to be a list format styled with CSS but am unsure of how to "define" the subcategories as the php generates them. I left the "spaces" that the original coder put in to make the categories line up. I want to remove those and use pure CSS to say this is a list.
Here is the current code:
<ul><!--Attempt to use list function -->
[PHP]<?
echo "<li>";
$sql = "select * from masterCategory";
echo "</li>", "</ul>";
$masterResult = mysql_query($sql);
while ($mr = mysql_fetch_array($masterResult)){
echo "<font color=\"#FFFFFF\" size=\"+1\">".$mr["name"]."</font><br>";
echo "<ul>","<li>";
$sql = "SELECT * FROM category where masterid = ".$mr["id"]." ORDER BY id";
$result = mysql_query($sql);
While($r = mysql_fetch_array($result)){
echo "<A href=\"preview.php?cat=".$r["id"]."\">".$r["name"]."</A><br>";
}
echo"</li>";
echo "<br>";
}
?>
[/PHP]</ul> <!-- moved the end of the listing AFTER the preview code -->
But, using this method, I just get too many indents. Please see:
listing go awry
Do I just insert echo <li> </li> for each line of generated subcategories? I know I can keep playing with it until I find what works, but I was hoping to spend some time on the proposal :>)
Am I making this too complicated?
I don't fully understand what you're trying to do... do you want to put it all into a table? Or just have each name/link on a new line? What are all the s for? I know what they do, but surely they are just indenting everything?
As far as I can see the data should get printed out like you said. Well actually like (indented by all the s):
Master 1
www.name1.com
www.name2.com
Master 2
www.name1.com
www.name2.com
A quick explanation of your php code (not sure what *read* means!):
Lines 1 and 2 get all of the master categories from your database.
And then lines 4-12 say:
for each one of the master categories -
print lots of and print the category name.
And then get from the database all of the records that match that category,
and for each of the matching records
print lots of
and print the link for it.
I hope something in that helps!...?
(Ok, so that ddn't actually come out indented anyway!)