DeepakJ Posted July 30, 2007 Share Posted July 30, 2007 How do you abort a while loop if a condition is met and the appropriate actions according to that loop have been taken. while($row2=mysql_fetch_array($bResult)){ if ($row2['productid']="") { $tableid = $row2['tableid']; $queryc = "UPDATE productid SET productid='$productid' WHERE tableid = $tableid"; } } I simply would like to abort the loop at the first instance of the nullstring. Help would be greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/62553-solved-how-do-you-abort-a-while-loop-if-a-condition-is-met/ Share on other sites More sharing options...
hitman6003 Posted July 30, 2007 Share Posted July 30, 2007 http://www.php.net/break Link to comment https://forums.phpfreaks.com/topic/62553-solved-how-do-you-abort-a-while-loop-if-a-condition-is-met/#findComment-311320 Share on other sites More sharing options...
DeepakJ Posted July 30, 2007 Author Share Posted July 30, 2007 Thanks again for the help. Link to comment https://forums.phpfreaks.com/topic/62553-solved-how-do-you-abort-a-while-loop-if-a-condition-is-met/#findComment-311321 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.