Jump to content

While loop


Walker33

Recommended Posts

Don't know what I'm doing wrong here, but if the the first of several entries in the db = true, it's fine.  If it's the third or fourth in the array, doesn't work.  Not sure where I'm missing in my while.

 

<?php
if ($result["r_approved"] == "APPROVED")    // transaction processed successfully
	// check demo table to see if they have a demo license:
{
$query5 = mysql_query("SELECT License_Num FROM demo_details WHERE ((RFirstName like '%$FName1%' AND RLastName like '%$LName1%') OR (REmail = '$billing_email') OR (SFirstName like '%$FName1%' AND SLastName like '%$LName1%') OR (SEmail = '$billing_email')) AND Outcome like ''");
$num5 = mysql_fetch_assoc($query5);
$license5 = $num5['License_Num'];
//check trial license table to see that they're still in there
$query6 = pg_query("SELECT license FROM triallics WHERE license = '$license5'");
$num6 = pg_fetch_assoc ($query6);

//if they had a demo and still in trial lic table, set them to PRO and delete from trial lics
$demo_user = false;
while ($demo_user !== true)
{
if ($num5 > 0 && $num6 > 0)
{$demo_user = true;
//Updating license to PRO
$proupdate = pg_query("UPDATE licences SET type = 'PRO' WHERE license like '$license5%' ");
//Deleting from triallics table
$demodelete = pg_query ("DELETE From triallics where license = '$license5' ");
}
}

}

?>

 

Really appreciate the help.

Link to comment
https://forums.phpfreaks.com/topic/157971-while-loop/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.