I have the following code that is working great:
Code: Select all
do {
$queryivhead = "SELECT * FROM ivheadtemp order by CUST_ID ASC";
$result=mysql_query($queryivhead);
$rowivhead = mysql_fetch_assoc($result);
$custid = $rowivhead ['CUST_ID'];
$ivpass = $rowivhead ['INVOICE_NO'];
$idpass = $rowivhead ['SO_NO'];
include 'iv.php';
mysql_query("INSERT INTO track (TRACK_SO_NO, TRACK_STATUS, TRACK_NOTES) VALUES ('".$idpass."','25','".$statusname."')");
mysql_query("DELETE FROM ivheadtemp WHERE INVOICE_NO=$ivpass");
$queryivhead1 = "SELECT * FROM ivheadtemp order by CUST_ID ASC";
$result1=mysql_query($queryivhead1);
$rowivhead1 = mysql_fetch_assoc($result1);
} while ($custid == $rowivhead1['CUST_ID']);
It is working great if I have a customer with 30 or less but the guys with 50-60 are killing me. Lets say I need to limit it to 20. I know I could do this:
Code: Select all
$num = 1;
while ( $num <=20 )
{
$num = $num + 1;
}
How can I define two conditions. Remember that if either one is true the script needs to terminate.