0

I'm carrying one variable in "reserva" wich I later I use $_GET('reserva'), but I also need another one of the rows,how could I do it?

<?php 

while($row = mysqli_fetch_array($search_result)):?>
    <tr>
        <td><?php echo $row['idps'];?></td>
        <td><?php echo $row['Descrição'];?></td>
        <td><?php echo $row['dia'];?></td>
        <td><?php echo $row['dataini'];?></td>
        <td><?php echo $row['datafim'];?></td>
        <td><?php echo $row['tblstaff_idPrestador'];?></td>

  
        <td><a href='marcar.php?reserva=<?php echo $row['idps'];?>'>Marcar</a></td>
        
        </tr>

    <?php endwhile;?>
Dharman
  • 30,962
  • 25
  • 85
  • 135
  • `&othervar=something` maybe. Or better build the string with https://www.php.net/manual/en/function.http-build-query.php – AbraCadaver Jun 18 '21 at 17:59

1 Answers1

1

Yes, you can append multiple values in a GET request using &:

<a href='marcar.php?reserva=<?php echo $row['idps'];?>&key=value'>Marcar</a>
                                                      ^^^^^^^^^^

as @raina77ow pointed out, be aware that & is a "reserved" char, so if your string contains that, you have to encode it, and for that, in PHP you have the function urlencode

Alberto Sinigaglia
  • 12,097
  • 2
  • 20
  • 48