Hi all.
I have a data table which has 8 fields:
secure_id_1_L
secure_id_2_L
secure_id_3_L
secure_id_4_L
secure_id_5_L
secure_id_6_L
secure_id_7_L
secure_id_8_L
each field hold YES or NO
I want to be able to count the number of "yes" fields in each record. This is what I have so far:
mysql_select_db($database_baggageppin, $baggageppin);
$query_baggage_lost = "SELECT secure_id_1_l,secure_id_2_l,secure_id_3_l,secure_id_4_l,secure_id_5_l,secure_id_6_l,secure_id_7_l,secure_id_8_l FROM amember_baggagemembers WHERE secure_id_1_l = "yes" OR secure_id_2_l = "yes" OR secure_id_3_l = "yes" OR secure_id_4_l = "yes" OR secure_id_5_l = "yes" OR secure_id_6_l = "yes" OR secure_id_7_l = "yes" OR secure_id_8_l = "yes"";
$query_limit_baggage_lost = sprintf("%s LIMIT %d, %d", $query_baggage_lost, $startRow_baggage_lost, $maxRows_baggage_lost);
$baggage_lost = mysql_query($query_limit_baggage_lost, $baggageppin) or die(mysql_error());
$row_baggage_lost = mysql_fetch_assoc($baggage_lost);
if (isset($_GET['totalRows_baggage_lost'])) {
$totalRows_baggage_lost = $_GET['totalRows_baggage_lost'];
} else {
$all_baggage_lost = mysql_query($query_baggage_lost);
$totalRows_baggage_lost = mysql_num_rows($all_baggage_lost);
}
$totalPages_baggage_lost = ceil($totalRows_baggage_lost/$maxRows_baggage_lost)-1;
?>
Can anyone point me in the reight direction.