Título: Imprimir los registros de la BD Publicado por: proteus8 en 22 Octubre 2011, 16:19 pm Hola a todos, tengo un problema que no sé cómo resolver, espero ustedes me puedan ayudar, bueno tengo el siguiente código:
<?phph $sql="SELECT ASA_ID,ASA_NOMBRE,SOC_NOMBRE,SOC_APELLIDOS,SOC_COR DENADA_X,SOC_CORDENADA_Y FROM geo_asambleas LEFT JOIN geo_socios ON geo_asambleas.ASA_ID=geo_socios.SOC_ASAMBLEA WHERE ASA_NOMBRE='union"; $result = mysql_query($sql); //segun esta consulta existen en mi BD 3 registros que cumplen esa condicion while ($row=mysql_fetch_array($result)) { //COMO SON MAS DE UN REGISTRO PUSE UN WHILE $CORDX=$row["SOC_CORDENADA_X"]; $CORDY=$row["SOC_CORDENADA_Y"]; $nom=$row["SOC_NOMBRE"]; // EN ESTA PARTE ES DONDE TENGO EL PROBLEMA, LA IDEA ES QUE POR CADA REGISTRO QUE ENCUENTRE EN LA BASE DE DATOS // ME CREE LA LINEA QUE ESTAN AQUÍ ABAJO, ES DECIR COMO SON TRES LOS REGISTRSO QUE TENGO DEBERIA TENER 3 LIENEAS DE ESTAS: $gm->SetAddress("$CORDX $CORDY"); // PERO NO SE COMO HACERLO } ¿> Por favor ayuda, no sé cómo hacerlo!!!! Desde ya muchas gracias!!!! Título: Re: Imprimir los registros de la BD Publicado por: #!drvy en 22 Octubre 2011, 18:10 pm Si te he entendido bien... lo que puedes hacer es, en vez de pasar directamente el parametro SetAddress, meter cada resultado en un array y luego pasarlo segun lo necesites...
Saludos Título: Re: Imprimir los registros de la BD Publicado por: proteus8 en 22 Octubre 2011, 19:10 pm gracias drvy | BSM por responder, eso que dices de meter los resultados en un array y luego pasarlos como se hace me podrias mostar un ejemplo, sorry pero es que no soy muy perito en php :-S
Título: Re: Imprimir los registros de la BD Publicado por: mokoMonster en 23 Octubre 2011, 19:19 pm <?php
$sql="SELECT ASA_ID,ASA_NOMBRE,SOC_NOMBRE,SOC_APELLIDOS,SOC_COR DENADA_X,SOC_CORDENADA_Y FROM geo_asambleas LEFT JOIN geo_socios ON geo_asambleas.ASA_ID=geo_socios.SOC_ASAMBLEA WHERE ASA_NOMBRE='union"; $result = mysql_query($sql); $num_result = mysql_num_rows($result); //segun esta consulta existen en mi BD 3 registros que cumplen esa condicion while ($row=mysql_fetch_array($result)) { //COMO SON MAS DE UN REGISTRO PUSE UN WHILE $CORDX=$row["SOC_CORDENADA_X"]; $CORDY=$row["SOC_CORDENADA_Y"]; $nom=$row["SOC_NOMBRE"]; // EN ESTA PARTE ES DONDE TENGO EL PROBLEMA, LA IDEA ES QUE POR CADA REGISTRO QUE ENCUENTRE EN LA BASE DE DATOS // ME CREE LA LINEA QUE ESTAN AQUÍ ABAJO, ES DECIR COMO SON TRES LOS REGISTRSO QUE TENGO DEBERIA TENER 3 LIENEAS DE ESTAS: // Esto deberia ser suficiente. while( $num_result < 0 ){ $gm->SetAddress("$CORDX $CORDY"); $num_result++; } // PERO NO SE COMO HACERLO } ?> |