I'm just wondering, how would one go about skipping a 'while' loop for a MySQL result? I have;
// do a while to grab the data...
while ($row = mysql_fetch_array ($result)) {
//make sure we only show dates that they want to see...
foreach ($dates as $val) {
if ($row[DueDate] == $val) { echo "<font color=green>match!</font>"; $ok = 1; last; }
}
// skip if the date is not correct to show...
if (!$ok) { next; }
if ($row[Done] == 1) { $done = "<font color=green>Yes</font>"; } else { $done = "<font color=red>No</font>"; }
$_entries .= "$row[DueDate]";
} // end the 'while'
Basically, I need to skip to the next entry in the results where I have next; , and also stop the 'foreach' where I have 'last'. Is 'next' a valid command in PHP? I know both next/last are valid in Perl, but I'm not so sure about PHP.
I'm pretty stuck here
Cheers
Andy
// do a while to grab the data...
while ($row = mysql_fetch_array ($result)) {
//make sure we only show dates that they want to see...
foreach ($dates as $val) {
if ($row[DueDate] == $val) { echo "<font color=green>match!</font>"; $ok = 1; last; }
}
// skip if the date is not correct to show...
if (!$ok) { next; }
if ($row[Done] == 1) { $done = "<font color=green>Yes</font>"; } else { $done = "<font color=red>No</font>"; }
$_entries .= "$row[DueDate]";
} // end the 'while'
Basically, I need to skip to the next entry in the results where I have next; , and also stop the 'foreach' where I have 'last'. Is 'next' a valid command in PHP? I know both next/last are valid in Perl, but I'm not so sure about PHP.
I'm pretty stuck here

Cheers
Andy