开发者

Php sql script issue

开发者 https://www.devze.com 2023-01-24 09:43 出处:网络
Please take a look at this code.... what is i have instead of average, above average, a two letter word?

Please take a look at this code.... what is i have instead of average, above average, a two letter word?

<input type="checkbox" name="petite" value="petite" <? if (get_option('petite') == 'petite'){ echo 'checked="checked"';} ?>>Petite
    <input type="check开发者_开发问答box" name="athletic" value="athletic" <? if (get_option('athletic') == 'athletic'){ echo 'checked="checked"';} ?>>Athletic
    <input type="checkbox" name="average" value="average" <? if (get_option('average') == 'average'){ echo 'checked="checked"';} ?>>Average
    <input type="checkbox" name="aboveaverage" value="above average" <? if (get_option('aboveaverage') == 'above average'){ echo 'checked="checked"';} ?>>Above average


$selectedCategories = array(); 
    foreach(array('petite', 'average', 'athletic') as $category) 
    { 
      if (get_option($category) == $category) 
      { 
        $selectedCategories[] = $category; 
      } 
    } 

    $qry = mysql_query( 
     "SELECT performerid,pic0  
        FROM ".$table."  
       WHERE build IN('" . implode("', '", $selectedCategories) . "')  
    ORDER BY RAND() LIMIT 20;"); 


The two letter word problem

Above average is that word - my first invention

change your code to

name="aboveaverage" value="aboveaverage"

my prediction.

I will edit my answer after you clarify your question

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号