Xtremer360 Posted February 17, 2009 Share Posted February 17, 2009 For some reason it won't stop saying A for the selected value. Don't know why. print '<tr>'; print '<td class="rowheading">Sort:</td>'; print '<td class="row3"><select name="sort" class="selection">'; print '<option value="A" ' . ( $row['sort'] == 'A' ? 'selected' : '' ) . '>A</option>'; print '<option value="B" ' . ( $row['sort'] == 'B' ? 'selected' : '' ) . '>B</option>'; print '<option value="C" ' . ( $row['sort'] == 'C' ? 'selected' : '' ) . '>C</option>'; print '<option value="D" ' . ( $row['sort'] == 'D' ? 'selected' : '' ) . '>D</option>'; print '<option value="E" ' . ( $row['sort'] == 'E' ? 'selected' : '' ) . '>E</option>'; print '<option value="F" ' . ( $row['sort'] == 'F' ? 'selected' : '' ) . '>F</option>'; print '<option value="G" ' . ( $row['sort'] == 'G' ? 'selected' : '' ) . '>G</option>'; print '<option value="H" ' . ( $row['sort'] == 'H' ? 'selected' : '' ) . '>H</option>'; print '<option value="I" ' . ( $row['sort'] == 'I' ? 'selected' : '' ) . '>I</option>'; print '<option value="J" ' . ( $row['sort'] == 'J' ? 'selected' : '' ) . '>J</option>'; print '<option value="K" ' . ( $row['sort'] == 'K' ? 'selected' : '' ) . '>K</option>'; print '<option value="L" ' . ( $row['sort'] == 'L' ? 'selected' : '' ) . '>L</option>'; print '<option value="M" ' . ( $row['sort'] == 'M' ? 'selected' : '' ) . '>M</option>'; print '<option value="N" ' . ( $row['sort'] == 'N' ? 'selected' : '' ) . '>N</option>'; print '<option value="O" ' . ( $row['sort'] == 'O' ? 'selected' : '' ) . '>O</option>'; print '<option value="P" ' . ( $row['sort'] == 'P' ? 'selected' : '' ) . '>P</option>'; print '<option value="Q" ' . ( $row['sort'] == 'Q' ? 'selected' : '' ) . '>Q</option>'; print '<option value="R" ' . ( $row['sort'] == 'R' ? 'selected' : '' ) . '>R</option>'; print '<option value="S" ' . ( $row['sort'] == 'S' ? 'selected' : '' ) . '>S</option>'; print '<option value="T" ' . ( $row['sort'] == 'T' ? 'selected' : '' ) . '>T</option>'; print '<option value="U" ' . ( $row['sort'] == 'U' ? 'selected' : '' ) . '>U</option>'; print '<option value="V" ' . ( $row['sort'] == 'V' ? 'selected' : '' ) . '>V</option>'; print '<option value="W" ' . ( $row['sort'] == 'W' ? 'selected' : '' ) . '>W</option>'; print '<option value="X" ' . ( $row['sort'] == 'X' ? 'selected' : '' ) . '>X</option>'; print '<option value="Y" ' . ( $row['sort'] == 'Y' ? 'selected' : '' ) . '>Y</option>'; print '<option value="Z" ' . ( $row['sort'] == 'Z' ? 'selected' : '' ) . '>Z</option>'; print '<option value="0-9" ' . ( $row['sort'] == '0-9' ? 'selected' : '' ) . '>0-9</option>'; print '</select></td>'; print '</tr>'; Quote Link to comment https://forums.phpfreaks.com/topic/145589-selected-value-not-showing-right/ Share on other sites More sharing options...
Philip Posted February 17, 2009 Share Posted February 17, 2009 What is the value of $row['sort'] show? Quote Link to comment https://forums.phpfreaks.com/topic/145589-selected-value-not-showing-right/#findComment-764338 Share on other sites More sharing options...
Xtremer360 Posted February 17, 2009 Author Share Posted February 17, 2009 Well it show A everytime. No matter what I have in the DB. Quote Link to comment https://forums.phpfreaks.com/topic/145589-selected-value-not-showing-right/#findComment-764342 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.