I-AM-OBODO Posted November 13, 2014 Share Posted November 13, 2014 Hi all. how can i make the values show like a list. I tried html line break "<br>" and php \n but all to no avail. It just show all the values in one straigth line. example of what i want is for the values to appear like this: 1234567890 0987654345 4567890675 instead of : 1234567890 0987654345 4567890675 Thanks <form data-abide method="post" action=""> <div> <select name=""> <option value="name"> <?php $stmt = $pdo->query("SELECT acct_num FROM table order by id desc"); while ( $row = $stmt->fetch(PDO::FETCH_ASSOC) ) { echo $row['acct_num']; } ?> </option> </select> </div> <div> <label>New Password <small>required</small></label> <input type="password" name="password" id="password" required> <small class="error">New password is required and must be a string.</small> </div> <div> <label>Confirm New Password <small>required</small></label> <input type="password" name="password2" id="password2" required> <small class="error">Password must match.</small> </div> <input name="submit" type="submit" class="button small" value="Change Password"> </form> Link to comment https://forums.phpfreaks.com/topic/292433-make-selected-values-appear-as-list/ Share on other sites More sharing options...
I-AM-OBODO Posted November 13, 2014 Author Share Posted November 13, 2014 Wow! after much playing around. Got it <?php $stmt = $pdo->query("SELECT acct_num FROM table ORDER BY id DESC"); while($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $acct_num = $row['acct_num']; echo "<option> $acct_num </option>"; } ?> Thanks all Link to comment https://forums.phpfreaks.com/topic/292433-make-selected-values-appear-as-list/#findComment-1496460 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.