estas son mis formas:
Código HTML:
<form id="form1" name="form1" method="post" action="buscanac.php"> <table width="680" border="0" align="center"> <tr> <td width="186" align="right" class="fuenteOp">Nombre:</td> <td width="304"><span id="sprytextfield1"> <input name="nom" type="text" id="nom" size="50" maxlength="60" /> </span></td> </tr> <tr> <td align="right" class="fuenteOp">Apellido Paterno:</td> <td><span id="sprytextfield2"> <input name="apepa" type="text" id="apepa" size="40" maxlength="50" /> </span></td> </tr> <tr> <td align="right" class="fuenteOp">Apellido Materno:</td> <td><span id="sprytextfield3"> <input type="text" name="apema" id="apema" size="40" maxlength="50" /> </span></td> </tr> <tr> <td align="right" class="fuenteOp"> </td> <td> </td> </tr> <tr> <td align="right" class="fuenteOp">Fecha de Nacimiento:</td> <td><span id="spryselect1"> <select name="strdia"> <option value=01>01</option> <option value=02>02</option> <option value=03>03</option> <option value=04>04</option> <option value=05>05</option> <option value=06>06</option> <option value=07>07</option> <option value=08>08</option> <option value=09>09</option> <option value=10>10</option> <option value=11>11</option> <option value=12>12</option> <option value=13>13</option> <option value=14>14</option> <option value=15>15</option> <option value=16>16</option> <option value=17>17</option> <option value=18>18</option> <option value=19>19</option> <option value=20>20</option> <option value=21>21</option> <option value=22>22</option> <option value=23>23</option> <option value=24>24</option> <option value=25>25</option> <option value=26>26</option> <option value=27>27</option> <option value=28>28</option> <option value=29>29</option> <option value=30>30</option> <option value=31>31</option> </select> <select name="strmes"> <option value=01>Ene</option> <option value=02>Feb</option> <option value=03>Mar</option> <option value=04>Abr</option> <option value=05>May</option> <option value=06>Jun</option> <option value=07>Jul</option> <option value=08>Ago</option> <option value=09>Sep</option> <option value=10>Oct</option> <option value=11>Nov</option> <option value=12>Dic</option> </select> <input type="text" name="stranio" maxlength="4" size="5" value=""> <span class="fuentesobl">Obligatorio.</span> <span class="selectRequiredMsg"></span></span>
Código PHP:
$dbhost = "host"; // El host
$dbuser = "user"; // El usuario
$dbpass = "clave"; // El Pass
$db = "bd"; // Nombre de la base
$connect = mysql_connect($dbhost,$dbuser,$dbpass); // se conecta con la db
mysql_select_db($db,$connect)or die(mysql_error());
$nom=$_POST["nombre"];
$apa=$_POST["apepa"];
$ama=$_POST["apema"];
$sex=$_POST["sexo"];
$di=(int)$_POST["strdia"];
$me=(int)$_POST["strmes"];
$an=(int)$_POST["stranio"];
$mun=$_POST["municipio"];
$consulta="SELECT nombre,apepa,apema,fechanacdia,fechanacmes,fechanacanio,localidad FROM nac where nombre like '%$nom%' and apepa like '%$apa%' and apema like '%$ama%' and fechanacdia='$di' and fechanacmes='$me' and fechanacanio='$an'";
$query=mysql_query($consulta,$connect);
echo $consulta;
$colo='#FFFFFF';
echo "<table border='1' cellpadding='4' cellspacing='0' align='center' class='fuentetxt' bgcolor='$colo'>";
echo "<tr><td>Nombre</td><td>Apellido Paterno</td><td>Apellido Materno</td><td>Día</td><td>Mes</td><td>Año</td><td>Municipio</td></tr>";
while ($reg=mysql_fetch_row($query)){
echo "<tr><td>";
echo $consulta['nom'];
echo "</td><td>";
echo $consulta['apa'];
echo "</td><td>";
echo $consulta['ama'];
echo "</td><td>";
echo $consulta['di'];
echo "</td><td>";
echo $consulta['me'];
echo "</td><td>";
echo $consulta['an'];
echo "</td><td>";
echo $consulta['mun'];
echo "</td></tr>";
foreach($reg as $cambia){
print "<td><div style='padding-left:22px; padding-top:9px; padding-right:10px ' class='fuentetxt' align='justify'>".utf8_encode($cambia) . "</td></div>";
}
}
if ($colo=="#FFFFFF"){
$colo="#99CCFF";
}else{
$colo= "#FFFFFF";
}
echo "</table>";
?>
este es la impresión del resultado
Código:
Les agradezco su ayuda, para resolver el problema. Saludos SELECT nombre,apepa,apema,fechanacdia,fechanacmes,fechanacanio,localidad FROM nac where nombre like '%%' and apepa like '%%' and apema like '%%' and fechanacdia='0' and fechanacmes='0' and fechanacanio='0'