0

i try this but it will only work when there is one value in the field.when multiple values in the field it will not work please help me get out of this..

Action

      if($row2->genre=='action'){echo 'checked=checked';} ?>>
     <?php //echo $row2->genre;?>
    adventure<input type='checkbox'name='chkbox[]'value='adventure'<?php if($row2->genre=='adventure'){echo 'checked=checked';} ?> >

1 Answers1

0

If you mean that $row2->genre is a string containing multiple genres, then

if(stristr($row2->genre,'action')){ echo /*whatever*/; }

whether you use checked=checked or just checked depends on your doctype.

Fo.
  • 3,752
  • 7
  • 28
  • 44