checkbox - php: Checkboxes and forms -
i have 20 checkboxes on form on website, need select between 1-3. u can have say
1, 2 , 3 or 4, 5 , 1
once user has selected checkboxes wants search database appropriate reply based on have selected.
my thought have 'if' statements mean have loads.
any other way around it?
if ((!empty($1))) { $sql= "select * db db.category convert( _utf8 '%1%' using latin1 ) collate latin1_swedish_ci $limit "; $result = mysql_query($sql); } else if ((!empty($1)) && (!empty($2))) { $sql= "select * db db.category convert( _utf8 '%1%' using latin1 ) collate latin1_swedish_ci , db.category convert( _utf8 '%2%' using latin1 ) collate latin1_swedish_ci $limit "; $result = mysql_query($sql);
}
if have checkbox array can utilize foreach cycle iterate through checked checkboxes. should give html o more specific checkbox values hold. seek reading: get $_post multiple checkboxes
php checkbox
No comments:
Post a Comment