Yo lo que quiero es que me muestre si inserte 3 datos que me aparezcan pero no triplicado, esto trata de una historia medica donde el paciente se le hace una reevaluacion con distintos especialista osea distinta especialidad y yo lo que quiero es que cuando consulte ese paciente me salga todas las reevaluaciones que tiene ese paciente x cada especialista que lo vieron.. sino me entiendes me avisas xfavor de todas formas abajo te voy a subbrayar en donde es que no me muestra lo que mando a hacer, por lo menos las variables son: nroreevaluacion,especialidad y fechare
Código
<html > <?php require_once('conection.php');?> <?php if ($_POST['Buscarmaestra'] == '1') { $consulta = "SELECT a.cedulam,a.nombrepa,a.apellidopa,b.nroreevaluacion,b.fechare,c.especialidad FROM paciente a, reevaluacion b, especialista c WHERE a.cedulam =b.cedulam and a.cedulam=".$_POST['txtbuscar']; if ($row_maestra > 0) { $nombre = $maestra['nombrepa']; $apellido = $maestra['apellidopa']; $_POST[nroreevaluacion]= $maestra['nroreevaluacion']; $_POST[fechare]= $maestra['fechare']; $_POST[especialidad]= $maestra['especialidad']; } else { echo"<script>"; echo "alert('No existe el paciente');"; echo "</script>"; } } ?> <head> <title>SICDI "Simón Bolívar"</title> <script type="text/javascript" src="validar.js"></script> <link href="estilosadri.css" rel="stylesheet" type="text/css" /></head> <script> function validarconsultarmaestra(forma, boton) { if(boton == 'buscar') { if(forma.txtbuscar.value == "") { alert("Ingrese la cédula"); forma.txtcod_nombre.focus(); forma.txtbuscar.value = ""; return; } forma.Buscarmaestra.value = '1' //forma.Guardarmaestra.value = '0'; //alert(forma.Buscarmaestra.value); } //alert("Buscar"+ forma.Buscarlenguaje.value+"Guardar"+ forma.Guardarlenguaje.value); forma.submit(); } </script> <body> <form name="form1_consultarmaestra" method="post" action="consultarreevaluacion.php"> <table width="754" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="66" colspan="7"><div align="center"><img src="mis imagenes/Copia de gobierno.png" alt="i" width="754" height="48" /></div></td> </tr> <tr> <td height="108" colspan="7"><div align="center"><img src="mis imagenes/banner3.png" alt="l" width="723" height="90" /></div></td> </tr> <tr bgcolor="#CC0000"> <td width="71" align="center"> </td> <td width="60" align="center"><a href="index.php">Inicio</a></td> <td width="100" align="center"><a href="panthistoria.php">Historia Médica </a></td> <td width="60" align="center"><a href="ayuda.php">Ayuda</a></td> <td width="100" align="center"><a href="cambiar_clave.php">Cambiar Clave</a> </td> <td width="60" align="center"><a onClick="javascript: return confirmar('¿Desea cerrar la sesión?')" href="cerrar_session.php">Cerrar</a></td> <td width="10" align="left"> </td> </tr> <tr bgcolor="#FFFFFF"> <td colspan="7" align="left"> </td> </tr> <tr bgcolor="#FFFFFF"> <td colspan="7" align="right" class="fecha"><strong> <script language="javascript" type="text/javascript"> function doClock() { window.setTimeout( "doClock()", 1000 ); today = new Date(); self.status = today.toString(); } doClock() </script> <script languaje="javascript"> var mydate=new Date() var year=mydate.getYear() if (year < 1000) year+=1900 var day=mydate.getDay() var month=mydate.getMonth() var daym=mydate.getDate() if (daym<10) daym="0"+daym var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado") var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre") document.write("<small><font color='cc0000' face='Arial'>"+dayarray[day]+" "+daym+" de "+montharray[month]+" de "+year+"</font></small>") </script> </strong></td> </tr> <tr bgcolor="#FFFFFF"> <td colspan="7"> </td> </tr> <tr bgcolor="#FFFFFF"> <td colspan="7" valign="bottom"><table width="754" border="0" align="center" cellpadding="0" cellspacing="5"> <tr> <th width="128" rowspan="12" valign="top" scope="row"><table width="100" align="left" cellpadding="0" cellspacing="0"> <tr> <td><img src="mis imagenes/fondo_box_top_l.jpg" alt="1" width="100" height="7"></td> </tr> <tr> <td bgcolor="#CC0000" class="cita">HISTORIA MÉDICA </td> </tr> <tr> <td bgcolor="#CC0000"> </td> </tr> <tr> <td bgcolor="#CC0000"><p align="center" class="citas"><a href="nuevoreevaluacion.php">Nuevo</a> </p> <p align="center" class="citas"><a href="modificarreevaluacion.php">Modificar</a></p> <p align="center" class="citas"> <a href="eliminarreevaluacion.php">Eliminar</a> </p> <p align="center" class="citas"><a href="consultarreevaluacion.php">Consultar</a></p></td> </tr> <tr> <td bgcolor="#CC0000"><img src="mis imagenes/fondo_box_bottom_l.jpg" alt="1" width="100" height="7"></td> </tr> </table></th> <td colspan="7" align="right" valign="top" class="caracter">Consultar</td> </tr> <tr> <td colspan="7" align="left" valign="top" class="texto"><table width="561" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="53" class="texto">Nombre:</td> <td width="74"><input name="txtnombre" type="text" class="cuadrot" id="txtnombre" size="10" value="<?php echo $nombre;?>" maxlength="8"></td> <td width="47" class="texto">Apellido:</td> <td width="78"><input name="txtapellido" type="text" class="cuadrot" id="txtapellido" size="10" value="<?php echo $apellido;?>" maxlength="8"></td> <td width="79" align="right"><span class="titulo">Buscar CI:</span></td> <td width="50"><input name="txtbuscar" type="text" class="cuadrot" id="txtbuscar" size="10" value="<?php echo $_POST['txtbuscar'];?>" maxlength="8"onkeypress="javascripts: return validarnum(event);"></td> <td width="54"><input name="Buscarmaestra" type="hidden" id="Buscarmaestra" value="0"/> <input name="cmdbuscar" type="button" class="cuadrot" id="cmdbuscar" value="Buscar" onClick="validarconsultarmaestra(this.form,'buscar')"/></td> </tr> </table></td> </tr> <tr> <td width="119" align="center" valign="top" class="titulo"> </td> <td width="91" align="center" valign="top" class="titulo"> </td> <td width="101" align="center" valign="top" class="titulo"> </td> <td width="109" align="center" valign="top" class="titulo"> </td> <td width="12" align="center" valign="top" class="titulo"> </td> <td width="12" align="center" valign="top" class="titulo"> </td> <td width="5" align="center" valign="top" class="titulo"> </td> </tr> <tr> <td align="center" valign="top" class="titulo"> </td> <td colspan="2" align="center" valign="top" class="titulo">Reevaluación</td> <td align="left" valign="top" class="titulo"> </td> <td align="center" valign="top" class="titulo"> </td> <td align="center" valign="top" class="titulo"> </td> <td align="center" valign="top" class="titulo"> </td> </tr> <tr> <td colspan="7" align="center" valign="top" class="titulo"> </td> </tr> <tr> <td colspan="7" align="left" valign="top" class="texto"><table width="600" border="0" cellspacing="1" cellpadding="0"> <tr> <td width="113" align="center" class="titulo">Nº Reevaluación </td> <td width="102" align="center" class="titulo">Especialista</td> <td width="94" align="center" class="titulo">Fecha</td> <td width="199"> </td> </tr> <tr> [color=pink] <td align="center" class="texto"><?php echo $maestra [nroreevaluacion]; ?></td> <td align="center" class="texto"><?php echo $maestra [especialidad]; ?></td> <td align="center" class="texto"><?php echo $maestra [fechare]; ?></td> <td><a href="usuario_detalle.php?nro=<?php echo $resul_cons['nroreevaluacion']; ?>">Detalle</a></td>[/color] </tr> </table> <p> </p> <table width="561" border="0" cellspacing="1" cellpadding="0"> <tr> <td width="138"> </td> <td width="62"> </td> <td width="232"><input name="cmdvolver" type="button" id="cmdvolver" value="Volver"onclick="javascripts: location.href='consultarlenguaje.php'" /> </td> <td width="38"> </td> </tr> </table></td> </tr> </table></td> </tr> <tr bgcolor="#CC0000"> </tr> </table> </form> </body> </html>