php - Default Value in a select -


this php application using pdo database binding. i'm working on edit form , have far works except drop down menu. can't seem show current value of device i'm editing. shows blank line. advice appreciated.

<select name='connectedterminal' id='connectedterminal'> <option value='0'>select terminal</option> <option value='$row[connectedterminal]' selected='selected' text='$row[connectedterminal]'></option> $options_terminal; </select>  

use if condition

<select name='connectedterminal' id='connectedterminal'> <option value='0'>select terminal</option> <option <?php if($row[connectedterminal] == '1') echo "selected " ?> value='1'>$row[connectedterminal]</option> <option <?php if($row[connectedterminal] == '2') echo "selected " ?> value='2'>$row[connectedterminal]</option> $options_terminal; // for? </select>  

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -