Page 1 of 1

trouble with while loop and ul/li style

Posted: Wed Apr 06, 2011 2:26 pm
by danwguy
So I have a script that queries the db and returns all the info, it should be displaying it as ul/li and it almost works right but there are some problems. here's the code...

Code: Select all

<div id="fees">
		<h1>Current Fee list</h1>
		
			<?php
				$fee = mysql_query("SELECT * FROM fees");
					if(!$fee) {
						$error = "Sorry could not select the fee schedule: " .mysql_error();
						}
					if($error !='') {
						echo "Sorry could not complete, we must exit and try again<br />";
						echo $error;
						exit();
						} else {
							while($row = mysql_fetch_assoc($fee)) {
								echo "<ul>" .$row['name'];
								echo "<li> Price </li>";
								echo "<ul>";
								echo "<li> $" .$row['price']. ".00</li>";
								echo "</ul>";
								if($row['date'] == '' || $row['date'] == 'NULL') { } else {
								echo "<li> Date </li>";
								echo "<ul>";
								echo "<li>" .$row['date'];
								echo "</ul>";
								}
								echo "<li> Additional Information</li>";
								echo "<ul>";
								echo "<li>" .$row['comments']. "</li>";
								echo "</ul>";
								echo "</ul>";
								}
							}
					?>
				</div>
it outputs the info but it looks like this...
Application Fee
•Price
◦$150.00•Additional Information
◦For international students
The CSS doesn't look like there is any problems in it... here's the CSS for that part...
[text]#fees {
width: 1000px;
float: left;
height: 415px;
text-align: center;
font-family: MyriadPro-Regular;
font-size: 16px;
}

#fees ul {
float: left;
align: left;
text-align: left;
font-size: 18px;
font-family: MyriadPro-Regular;
font-style: bold;
margin-left: 10px;
}

[/text]
I can't seem to figure out why the "Additional information is displaying next to the price, it should be below it. Any help please, Thank you.

Re: trouble with while loop and ul/li style

Posted: Wed Apr 06, 2011 8:52 pm
by fugix
What are the errors that you receive?