Jump to content

Recommended Posts

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.