Jump to content

Carregar option value com dados da tabela


Recommended Posts


Tenho várias "option value", quando faço editar quero carregar o valor guardado que está guardado noutra tabela "empresa", e os outros que vêm directamente da tabela "cliente".

Basicamente quero carregar o valor guardado por defeito, e mostrar os outros existentes na tabela, para ao editar poder escolher outro código diferente.

						  <tr align="left">
							<td class="texto_form" align="center"> Código Cliente  </td>
							<td align="left">
								$query=mysql_query("SELECT * FROM cliente  WHERE cod_fin = '".$rs['cod_fin']."' ORDER BY cod_post ASC");
							  <select name="cod_fin" style="text-align:left;" title="Seleccione o Código">
								  while($dados = mysql_fetch_array($query))
								<option value="<?= $dados['cod_fin']; ?>"> <?= ucwords($dados['cod_fin']) . " - " . $dados['desig_fin'] ;?> </option>

Edited by Labroskas
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. 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.