ahi te hize unos comentarios en el codigo, leelos y me dices si si te sirvieron o si necesitas algo mas, saludos.
Código PHP:
[PHP]<?
$conexio = mysql_connect("localhost","root","clave");
mysql_select_db ("safsur1", $conexio) OR die ("No se puede conectar");
$sql="SELECT * FROM comercio";
$result=mysql_query($sql,$conexio);
}
?>
<html>
<style type="text/css">
<!--
.Estilo1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
.Estilo2 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
}
-->
</style>
<body>
<span class="Estilo2">Registro de Credito de Persona Fisica :</span><br>
<FORM METHOD="POST" ACTION="insert_pf.php">
<table align="center" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="75%" id="AutoNumber1" height="355">
<tr bgcolor="#6699CC">
<td height="19" colspan="6"><b><font face="Verdana" size="1">
Registro de Persona Física:</font></b></td>
</tr>
<tr>
<td height="19" colspan="6"> </td>
</tr>
<tr>
<td width="25%" height="24"><font face="Verdana" size="1">Apellido</font></td>
<td width="1%" height="24"> </td>
<td width="28%" height="24"><INPUT NAME="apellido" MAXLENGTH="100" TYPE="TEXT" VALUE=""></td>
<td width="12%" height="24"><font face="Verdana" size="1">Nombre:</font></td>
<td width="1%" height="24"> </td>
<td width="33%" height="24"><INPUT NAME="nombre" MAXLENGTH="100" TYPE="TEXT" VALUE=""></td>
</tr>
<tr>
<td width="25%" height="19"><font face="Verdana" size="1">Dirección:</font></td>
<td width="1%" height="19"> </td>
<td width="28%" height="19"><INPUT NAME="direccion" MAXLENGTH="100" TYPE="TEXT" VALUE=""></td>
<td width="12%" height="19"><font face="Verdana" size="1">Documento:</font></td>
<td width="1%" height="19"> </td>
<td width="33%" height="19">
<label>
<select name="documento">
<option>Seleccione</option>
<option>D.N.I.</option>
<option>C.E.</option>
<option>C.I.</option>
<option>Doc. Extranjero</option>
</select>
<input name="numero_doc" maxlength="100" type="TEXT" value="">
</label></td>
</tr>
<tr>
<td width="25%" height="19"><font face="Verdana" size="1">Teléfono:</font></td>
<td width="1%" height="19"> </td>
<td width="28%" height="19"><INPUT NAME="telefono" MAXLENGTH="100" TYPE="TEXT" VALUE=""></td>
<td width="12%" height="19"><font face="Verdana" size="1">Celular:</font></td>
<td width="1%" height="19"> </td>
<td width="33%" height="19"><INPUT NAME="celular" MAXLENGTH="100" TYPE="TEXT" VALUE=""></td>
</tr>
<tr>
<td width="25%" height="19"><font face="Verdana" size="1">Situación Laboral:</font></td>
<td width="1%" height="19"> </td>
<td width="28%" height="19"><INPUT NAME="situacion" MAXLENGTH="100" TYPE="TEXT" VALUE=""></td>
<td width="12%" height="19"><font face="Verdana" size="1">Ciudad:</font></td>
<td width="1%" height="19"> </td>
<td width="33%" height="19"><INPUT NAME="ciudad" MAXLENGTH="100" TYPE="TEXT" VALUE=""></td>
</tr>
<tr>
<td width="25%" height="19"><font face="Verdana" size="1">Cod. Postal:</font></td>
<td width="1%" height="19"> </td>
<td width="28%" height="19"><INPUT NAME="cod_postal" MAXLENGTH="100" TYPE="TEXT" VALUE=""></td>
<td width="12%" height="19"><font face="Verdana" size="1">Mail:</font></td>
<td width="1%" height="19"> </td>
<td width="33%" height="19"><INPUT NAME="mail" MAXLENGTH="100" TYPE="TEXT" VALUE=""></td>
</tr>
<tr>
<td width="25%" height="19"><font face="Verdana" size="1">Observaciones:</font></td>
<td width="1%" height="19"> </td>
<td height="19" colspan="4">
<label>
<textarea name="observaciones" cols="50"></textarea>
</label> </td>
</tr>
<tr>
<td height="19" colspan="6"> </td>
</tr>
<tr bgcolor="#6699CC">
<td height="19" colspan="6"><b><font face="Verdana" size="1">
Datos del Crédito Solicitado:</font></b></td>
</tr>
<tr>
<td height="19" colspan="6"> </td>
</tr>
<tr>
<td width="25%" height="19"><font face="Verdana" size="1">Comercio:</font></td>
<td width="1%" height="19"> </td>
<td width="28%" height="19">
<?php
//esto la verdad no se de donde lo saca pero creo que en mysql uno utiliza el WHERE para alguna condicion.
//tambien hace falta que selecciones los campos que vas a tomar en defecto pon * para que te tome todos los que tenga la tabla
$query = "select FROM comercio LIKE 'razon_social'";
?>
<select name="comercios">
<option>Seleccione Comercio</option>
<?php
//la variable consulta tampoco se de donde la sacas ahi lo que eberia ir es la variable resultado de la consulta que hiciste arriba $result
while ($row = mysql_fetch_assoc($consulta /* $result */)) {
//yo trabajo de la siguiente manera pongo primero comillas sencillas y despues utilizo las dobles
//ojo porque tambien te hacia falta las comillas del nombre del campo de la tabla ahi te corregi el codigo solo modificalo
//y listo asi creo que deberia trabajar bien, me dices si tienes algun problema.
// echo '<option value="$row['comercio']">$row[comercio]</option>';
echo " <option value='$row[comercio]>$row[comercio]</option>";
}
?>
</select></td>
<td width="12%" height="19"><font face="Verdana" size="1">Dirección:</font></td>
<td width="1%" height="19"> </td>
<td width="33%" height="19"><INPUT NAME="dir_comercio" MAXLENGTH="100" TYPE="TEXT" VALUE=""></td>
</tr>
<tr>
<td width="25%" height="18"><font face="Verdana" size="1">Teléfono:</font></td>
<td width="1%" height="18"></td>
<td width="28%" height="18"><INPUT NAME="tel_comercio" MAXLENGTH="100" TYPE="TEXT" VALUE=""></td>
<td width="12%" height="18">
<p dir="ltr"><font face="Verdana" size="1">Valor Crédito:</font></td>
<td width="1%" height="18"></td>
<td width="33%" height="18"><INPUT NAME="valor_credito" MAXLENGTH="100" TYPE="TEXT" VALUE=""></td>
</tr>
<tr>
<td width="25%" height="19"><font face="Verdana" size="1">Cant. Cuotas</font></td>
<td width="1%" height="19"> </td>
<td width="28%" height="19">
<label>
<select name="cant_cuotas">
<option>Seleccione Cant. Cuotas</option>
<option>1</option>
<option>3</option>
<option>6</option>
<option>12</option>
<option>18</option>
<option>24</option>
<option>30</option>
<option>48</option>
<option>60</option>
</select>
</label> </td>
<td width="12%" height="19"><font face="Verdana" size="1">Morosidad:</font></td>
<td width="1%" height="19"> </td>
<td width="33%" height="19"><INPUT NAME="morosidad" MAXLENGTH="100" TYPE="TEXT" VALUE=""></td>
</tr>
<tr>
<td width="25%" height="19"><font face="Verdana" size="1">Estado:</font></td>
<td width="1%" height="19"> </td>
<td width="28%" height="19">
<label>
<select name="estado_morosidad">
<option>Seleccione Estado</option>
<option>MOROSO</option>
<option>ANTECEDENTE</option>
<option>INSTANCIA JUCICIAL</option>
</select>
</label> </td>
<td width="12%" height="19"> </td>
<td width="1%" height="19"> </td>
<td width="33%" height="19"> </td>
</tr>
<tr>
<td height="19" colspan="6"> </td>
</tr>
<tr>
<td height="19" colspan="6"><div align="center">
<input name="Reset2" type="RESET" Value="Limpiar Datos">
<INPUT NAME="boton2" TYPE="SUBMIT" VALUE="Grabar Datos">
</div></td>
</tr>
</table>
</form>
</body>
</html>
[/PHP]