Php link that has a variable

0

I have a set of results that I put with echo and I want to put at the end a link that bears the id of the record, how can I do it?

while($fila=mysqli_fetch_array($resultados, MYSQLI_ASSOC))  
        {               
            echo "<tr align='center'>";
            echo "<td>". $fila['identificacion'] . "</td>";

            echo "<td>". $fila['nombre'] . "</td>";
            echo "<td>". $fila['direccion'] . "</td>";
            echo "<td>". $fila['telefono'] . "</td>";
            echo "<td>". $fila['correo'] . "</td>";
            echo "<td>". $fila['sexo'] . "</td>";
            echo "<td>". $fila['estado_civil'] . "</td>";   
            echo "<td><a href='cliente_editar.php?identiticacion=<?php echo $fila['identificacion']?>'>Editar</a></td>";
            echo "<td><a href='cliente_borrar.php'>Borrar</a></td>";
            echo "</tr>";           

        }
    
asked by Jhon Hernández 01.06.2018 в 15:36
source

1 answer

0

you just have to keep concatenating like the other data ... something like this would be ...

while($fila=mysqli_fetch_array($resultados, MYSQLI_ASSOC))  
        {               
            echo '<tr align="center">';
            echo '<td>'. $fila['identificacion'] . '</td>';
            echo '<td>'. $fila['nombre'] . '</td>';
            echo '<td>'. $fila['direccion'] . '</td>';
            echo '<td>'. $fila['telefono'] . '</td>';
            echo '<td>'. $fila['correo'] . '</td>';
            echo '<td>'. $fila['sexo'] . '</td>';
            echo '<td>'. $fila['estado_civil'] . '</td>';   
            echo '<td><a href="cliente_editar.php?identiticacion='.$fila['identificacion'].'">Editar</a></td>';
            echo '<td><a href="cliente_borrar.php?identificacion='.$fila['identificacion'].'">Borrar</a></td>';
            echo '</tr>';           

        }

I think it's easier to work with simple quotes '' and the inside with normal quotes "" ...

    
answered by 01.06.2018 / 15:47
source