pixeltrace Posted March 9, 2007 Share Posted March 9, 2007 guys, i need help, i have a selectbox in my update form items on my selectbox will be taken from the database and from the update form you can re-select other items and have it update my problem now is, i can't make it work, i use implode and i am getting some errors implode()function implode: argument to implode must be in array how do i fix this? below is the code for my selectbox <select name="specialization[]" size="8" class="field3" multiple="multiple"> <option value="<? echo implode("\n",$specialization); ?>" selected><? echo implode($specialization); ?></option> <? include 'db_connect.php'; $uSql = "SELECT specialization FROM specialization ORDER by sid ASC"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; } else{ while($uRow = mysql_fetch_row($uResult)){ ?> <option value="<?= $uRow[0]?>"> <?= $uRow[0]?> </option> <? } } ?> </select> hope you could help me with this. thanks! Link to comment https://forums.phpfreaks.com/topic/41940-need-help-on-my-selectbox-multiple/ Share on other sites More sharing options...
pixeltrace Posted March 9, 2007 Author Share Posted March 9, 2007 hi, any help on this one? thanks! Link to comment https://forums.phpfreaks.com/topic/41940-need-help-on-my-selectbox-multiple/#findComment-203352 Share on other sites More sharing options...
pixeltrace Posted March 9, 2007 Author Share Posted March 9, 2007 help please! thanks! Link to comment https://forums.phpfreaks.com/topic/41940-need-help-on-my-selectbox-multiple/#findComment-203530 Share on other sites More sharing options...
redarrow Posted March 9, 2007 Share Posted March 9, 2007 Use a for loop then or a while loop ok. Link to comment https://forums.phpfreaks.com/topic/41940-need-help-on-my-selectbox-multiple/#findComment-203533 Share on other sites More sharing options...
pixeltrace Posted March 9, 2007 Author Share Posted March 9, 2007 can you help me with the codes? i dont have any idea how to fix it. thanks! Link to comment https://forums.phpfreaks.com/topic/41940-need-help-on-my-selectbox-multiple/#findComment-203723 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.