i would like to know how i can break out of a 'for' loop and tell it to start again with the next iteration.
for example i am using the code below to loop through an array of results i have previously got from a table and then use the returned rows to execute a series of sql statements.
Code: Select all
for ($count=0; $row=mysql_fetch_array($ID_array); $count++)
{
$conn = OpenDBConnection();
$selprod = "select * from Products where ProductID = " .$rowї'ProductID']. " and Discontinued = 'False'";
$result = mysql_query ($selprod, $conn) or die(mysql_error());
$row_result = mysql_num_rows ($result);
CloseDBConnection($conn);
if ($row_result >= 1)
{ //code in here where i want it to break out of function and loop on to the next iteration }
else {Thanks in advance for any help