I have this while-loop code for returning data from database
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_array($result)) {
(some not important lines...)
echo "<div><a href='remove.php?id=<?php echo ".$row['id'].";?>'>remove record</a></div>";
and I want to pass id variable by GET to my remove.php
<?php
include '../db.php';
$id = $_GET['id'];
$con = mysqli_connect($host, $user, $pass, $db);
mysqli_query($con, 'DELETE FROM zapisy WHERE id='$id';')
mysqli_close($con);
?>
but everytime I click on my link it redirects to
remove.php?id=<?php%20echo%2042;?> // <?php echo 42;?> without all that mess, id is good
leaving that php tags, that I think should not be here, and not passing my variable to another page - first problem; second - php returns
Parse error: syntax error, unexpected T_VARIABLE in .../admin-panel/remove.php on line 5
which tells me something is wrong with the mysql spelling nearby variable, but I was looking for answer and nothing. I changed ' ' to " " and opposite, and nothing. Or is it because variable is not getting value passed and its empty?
I would be very thankful if someone could help me or point me the right path, because I'm stuck at this point and I am just beginning with coding.