Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/05/2005, 14:04
Avatar de ignacio_giri
ignacio_giri
 
Fecha de Ingreso: febrero-2003
Ubicación: Argentina, Rosario
Mensajes: 585
Antigüedad: 21 años, 2 meses
Puntos: 0
Eliminar ultima "," (coma) - PHP y JavaScript

Código PHP:
<?php 
$tablaFotos 
"inmoby_conf_fotos";
$tablaInmuebles "inmoby_inmuebles";
$consulta2 mysql_query"SELECT $tablaFotos.id FROM $tablaFotos,$tablaInmuebles
             WHERE $tablaFotos.id_inmueble = "
.$_GET['id']." AND $tablaInmuebles.id = $tablaFotos.id_inmueble" ) or errormysql_error() ); ?>
var photoArray = new Array(
 
<?php 
while ( $renglon2 mysql_fetch_array ($consulta2) ) { ?>
new Array("<?php echo "".$renglon2[id].""?>_fotog.jpg", "450", "321", "Visite Inmoby.com"), //esta ultima coma no la quiero!!! :(
<?php ?>
 
);

y todo eso me imprime:

var photoArray = new Array(

new Array("146_fotog.jpg", "450", "321", "Visite Inmoby.com"),
new Array("147_fotog.jpg", "450", "321", "Visite Inmoby.com"),
new Array("148_fotog.jpg", "450", "321", "Visite Inmoby.com"),
new Array("149_fotog.jpg", "450", "321", "Visite Inmoby.com"),
new Array("150_fotog.jpg", "450", "321", "Visite Inmoby.com"),
new Array("151_fotog.jpg", "450", "321", "Visite Inmoby.com"),
new Array("152_fotog.jpg", "450", "321", "Visite Inmoby.com"),

);


la "," que esta marcada en "negrita" no la quiero!

Saludos
__________________
Ignacio

Última edición por ignacio_giri; 18/05/2005 a las 14:13