Link to home
Start Free TrialLog in
Avatar of doctorbill
doctorbillFlag for United Kingdom of Great Britain and Northern Ireland

asked on

php loops

Code:
<?php
$result = mysql_query( "SELECT * FROM reminder_events ORDER BY reminder_date DESC" );
$nr = mysql_num_rows( $result );
if(empty($nr))
{
echo("
<tr>
<td colspan='3'>No Reminders setup</td>
</tr>
");
}
while( $row = mysql_fetch_array( $result ))
{
$reminder_name = $row["reminder_name"];
$reminder_desc = $row["reminder_desc"];
$reminder_date = $row["reminder_year"]."-".$row["reminder_month"]."-".$row["reminder_date"];
$reminder_id = $row["reminder_id"];

echo("

<tr>
<td width='20%' id=reminder_body_name>$reminder_name</td>
<td width='60%' id=reminder_body>$reminder_desc</td>
<td width='10%' id=reminder_body_date>$reminder_date</td>
<td width='10%'><a href='reminder_list.php?reminder_id=$reminder_id'>delete</a></td>
</tr>
");
}
mysql_free_result( $result );
?>

The above code is working fine but I am trying to introduce a double line break after each set oif results - ie after the line:
<td width='10%'><a href='reminder_list.php?reminder_id=$reminder_id'>delete</a></td>
</tr>
If I use the <br /> tag it is just appended to the top of the page
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Wrap each set of results (in this case, each <tr>) in <table> tags to make them individual tables, and then put the <br> tags between tables.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of doctorbill

ASKER

Solved
Thanks for the advice