Jump to content
Fórum Script Brasil
  • 0

Php E Mysql


SirSmart

Question

Galera tenho uma combo onde tenhos 5 infomações dentro dela....

Eu seleciono uma delas e faço um update.

Quando vou entrar novamente no meu cliente, minha combo fica vazia, não fica preenchida com o valor que acabei de atualizar......

Como eu faço pra que isso nãp aconteça, eis o código da parte da combo.....


if($row[20]=="S") $selected_S = " SELECTED"; else $selected_S = "";
      if($row[20]=="C") $selected_C = " SELECTED"; else $selected_C = "";
      if($row[20]=="V") $selected_V = " SELECTED"; else $selected_V = "";
      if($row[20]=="D") $selected_D = " SELECTED"; else $selected_D = "";
    	
      echo '<b> Estado Civil: </b><select name="estcivil" value="'.$row[20].'"  tabindex="15" onkeypress=blockenter();  ><option value="" >- -selecione- -';
      echo '        <option value="S" '.$selected_S.' >Solteiro';
      echo '        <option value="C" '.$selected_S.' >Casado';
      echo '        <option value="V" '.$selected_S.' >Viúvo';
      echo '        <option value="D" '.$selected_S.' >Divorciado</select>';
    	

Obrigado

Link to comment
Share on other sites

2 answers to this question

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      651.9k
×
×
  • Create New...