Foros del Web » Programando para Internet » PHP »

Error en estructura

Estas en el tema de Error en estructura en el foro de PHP en Foros del Web. Hola amigos Tengo el código Código PHP:          $nCont=0;          while ($row2 = mysql_fetch_array($result2)){             echo "<tr> \n"; // en la linea siguiente me da el error             echo "<td><center>  ".TRIM($row2["COMPANIA"])."</center></td>  \n";?><input type="hidden" name="compania"  value=" <?php  echo  ".TRIM($row2[" COMPANIA "])." ; ?> "> <?php        echo  "<td><right><b>" . TRIM ...
  #1 (permalink)  
Antiguo 30/10/2007, 06:23
 
Fecha de Ingreso: junio-2007
Mensajes: 80
Antigüedad: 16 años, 10 meses
Puntos: 1
Error en estructura

Hola amigos
Tengo el código
Código PHP:
         $nCont=0;
         while ($row2 = mysql_fetch_array($result2)){
            echo "<tr> \n";
// en la linea siguiente me da el error
            echo "<td><center>  ".TRIM($row2["COMPANIA"])."</center></td>  \n";?><input type="hidden" name="compania"  value="<?php echo ".TRIM($row2["COMPANIA"]).";?>">
<?php       echo "<td><right><b>".TRIM($row2["CALLE"])."</b></right></td>  \n";?><input type="hidden" name="calle"     value="<?php echo ".TRIM($row2["CALLE"]).";?>">            
<?php       echo "<td><right><b>".TRIM($row2["POBLA"])."</b></right></td>  \n";?><input type="hidden" name="poblacion" value="<?php echo ".TRIM($row2["POBLA"]).";?>">
<?php       echo "<td><right><b>".TRIM($row2["PROVIN"])."</b></right></td> \n";?><input type="hidden" name="provincia" value="<?php echo ".TRIM($row2["PROVIN"]).";?>">
<?php       echo "<td><right><b>".TRIM($row2["CP"])."</b></right></td>     \n";?><input type="hidden" name="cp"        value="<?php echo ".TRIM($row2["CP"]).";?>">
<?php               
            
echo "<td colspan=5 align=center><br><input type=submit value='Confirmar'></br></center></td></tr>";
            
$nCont += $nCont+1;
         }
Y me da error de estructura en la linea que lo indico encima.
El error que me aparece es
Cita:
Parse error: parse error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\Archivos de programa\EasyPHP 2.0b1\www\punto_r.php on line 44
Como si le falta o le sobra alguna coma, comillas etc.

Que puede ser?
Saludos
  #2 (permalink)  
Antiguo 30/10/2007, 06:50
Avatar de xempro  
Fecha de Ingreso: marzo-2007
Ubicación: Chile
Mensajes: 222
Antigüedad: 17 años, 1 mes
Puntos: 6
Re: Error en estructura

Prueba esto
<?php
$nCont=0;
while ($row2 = mysql_fetch_array($result2)){
?>
<tr>
<td><center><?php echo trim($row2["COMPANIA"]); ?><input type="hidden" name="compania" value="<?php echo trim($row2["COMPANIA"]);?>"></center></td>
<td><right><b><?php echo trim($row2["CALLE"]);?></b><input type="hidden" name="calle" value="<?php echo trim($row2["CALLE"]);?>"></right></td>
<td><right><b><?php echo trim($row2["POBLA"]); ?></b><input type="hidden" name="poblacion" value="<?php echo trim($row2["POBLA"]);?>"></right></td>
<td><right><b><?php echo trim($row2["PROVIN"]); ?></b><input type="hidden" name="provincia" value="<?php echo trim($row2["PROVIN"]);?>"></right></td>
<td><right><b><?php echo trim($row2["CP"]); ?></b><input type="hidden" name="cp" value="<?php echo trim($row2["CP"]);?>"></right></td>
<td colspan=5 align=center><br><input type=submit value='Confirmar'></br></center></td>
</tr>
<?
$nCont += $nCont+1;
}
?>
  #3 (permalink)  
Antiguo 30/10/2007, 07:30
 
Fecha de Ingreso: junio-2007
Mensajes: 80
Antigüedad: 16 años, 10 meses
Puntos: 1
Re: Error en estructura

Muchas gracias
Lo he probado, y perfecto
Me lio cuando mezclo php con otra cosa

Saludos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:48.