Agregar items a combo
Publicado por EfrainMejiasC (45 intervenciones) el 04/09/2012 15:06:34
Hola
Selecciono de mi base de datos una lista de codigo, luego quiero agregarla a un selected,
Como puedo hacer??
Selecciono de mi base de datos una lista de codigo, luego quiero agregarla a un selected,
Como puedo hacer??
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//Archivo pru.php
<?php
error_reporting(0);
$vector = array();$i=0;
include("Conexion.php");
$cnx = mysql_connect($host,$user,$pw) or die ("Problemas de Conexion1");
mysql_select_db($db,$cnx)or die ("Problemas de Conexion2");
$registro=mysql_query("SELECT codigo FROM prima")
or die ("ERROR".mysql_error());
while($reg=mysql_fetch_array($registro))
{
$vector=$reg['co'];
echo $vector;
$i++;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
</head>
<body>
<form name="prueba" method="post" action="pru.php">
<select type="selected" name="tipoMantto"> <option selected="selected">
</select>
</form>
Valora esta pregunta


0