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!!!!
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
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
<?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
}
?>