Autor
|
Tema: Imprimir los registros de la BD (Leído 1,422 veces)
|
proteus8
Desconectado
Mensajes: 55
|
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!!!!
|
|
|
En línea
|
|
|
|
#!drvy
|
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
|
|
|
En línea
|
|
|
|
proteus8
Desconectado
Mensajes: 55
|
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
|
|
|
En línea
|
|
|
|
mokoMonster
Desconectado
Mensajes: 301
<? ...
|
<?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
} ?>
|
|
|
En línea
|
"Se necesitaron unos instantes para cortarle la cabeza, pero se necesitara un siglo para producir otra igual." Lagrange
|
|
|
|
Mensajes similares |
|
Asunto |
Iniciado por |
Respuestas |
Vistas |
Último mensaje |
|
|
Como imprimir un .pdf que no te deja imprimir?
Windows
|
nichihack
|
8
|
24,902
|
2 Mayo 2013, 15:30 pm
por sol19200
|
|
|
registros es c++
Programación C/C++
|
bash
|
1
|
2,937
|
16 Mayo 2010, 16:50 pm
por bash
|
|
|
c++ y registros
Programación C/C++
|
winnipu
|
3
|
2,955
|
30 Julio 2010, 16:36 pm
por [L]ord [R]NA
|
|
|
[Registros] existe algún registro para Outlook en los registros de windows?
Windows
|
moikano→@
|
5
|
6,886
|
14 Febrero 2011, 14:56 pm
por dantemc
|
|
|
registros del msn
Mensajería
|
lizzapodrida
|
4
|
4,605
|
26 Septiembre 2011, 22:02 pm
por scr21
|
|