php - Dynamic href when generating buttons? -
i have table displaying data user , each row in table has unique id, in table generating button each row more information on content in row. however, need generate unique href each button based on unique id of data in row. way have done it correctly goes link in href without passing unique id.
<tbody> <?php while($row = $query->fetch()) { ?> <tr> <td><?php echo $row['car_id']; ?></td> <td><?php echo $row['car_make']; ?></td> <td><?php echo $row['car_model']; ?></td> <td><?php echo $row['number_available']; ?></td> <td><?php echo $row['rent_cost_per_day']; ?></td> <td><a class="btn btn-default" href="cars.php?"<?php $row['car_id']; ?>>view</a></td> </tr> <?php } ?> </tbody>
any help?
this because put php
after closed href
quotes. have not put echo
function php
, , have not put variable. have:
href="cars.php?"<?php $row['car_id']; ?>
what want have is:
href="cars.php?id=<? echo $row['car_id']; ?>"
Comments
Post a Comment