RE:como creo lista desplegable con una consulta SQ
<html>
<head>
<title>Prueba de PHP</title>
</head>
<body>
<?php
include("conec.php");
$link=Conectarse();
$result=mysql_query("select * from tablacurso",$link);
?>
<form name="form1" method="post" action="">
<select name="select">
<?php
while($row = mysql_fetch_array($result)) {
print("<option value=\"".$row["campoValor"]."\">".$row["campoTexto"]."</option>");
}
mysql_free_result($result);
?>
</select>
</form>
</body>
</html>
y conec.php tiene
function Conectarse()
{
if (!($link=mysql_connect("localhost","usaurio","password")))
{
exit();
}
if (!mysql_select_db("basecurso",$link))
{
exit();
}
return $link;
}