Is there a way to resume or continue with the next $value of the foreach loop if the query result is null or empty? If so, how please? The way this is supposed to work is $_POST['select'] contains multiple zip codes. As $value is iterated, vacpct is selected from the database to be placed in an array. The problem is, if a zip code has 0 (zero) for vacpct, the result of the query is null or empty (not sure which) as only zip codes that have vacpct that are greater than 0 (zero) are to be selected. When this happens, the action stops, and the next $value(s) or zip codes are not itereated. I need a way to continue with the next $value when this happens. Thanks in advance.
PHP Code:
foreach ($_POST['selectzip'] as $value) {
if ($value != " ") {
$resultsvacpct = "SELECT vacpct FROM wamuexp where vacpct > 0 && zip LIKE '$value%' ORDER BY vacpct"; $sql_resultsvacpct = mysql_query($resultsvacpct,$dbc);
$i=0; while ($row = mysql_fetch_array($sql_resultsvacpct)) { // load array with data from table $vacpctarr[] = $row[vacpct];