I'm sorry if this is unclear or difficult to understand, but explaining what I am attempting to do isn't that easy over text. In the HTML code like this entry works:
<th><a href="members.php?id=<?php echo 'name';?>&action=<?php echo $action;?>">Name</a></th>
<td><?php echo $row["name"];?></td>
but in PHP I can not advise:
echo "<th><a href="members.php?id=<?php echo 'name';?>&action=<?php echo $action;?>">Name</a></th>";
echo "<td><?php echo $row["name"];?></td>";
"id" has value /name, lastname, city, district/
"action" has value /ASC, DESC/
Complete table for clarity I not want to indicate. Can you help me?
Now I have:
echo "<th><a href=\"members.php?id=<?php echo 'name';?\>&action=<?php echo $action;?\>\">Name</a></th>";
echo "<td><?php echo '".$row['name']."';?\></td>";
expected result in URL is:
.../members.php?id=name&action=ASC
but my is:
.../members.php?id=<?php%20echo%20%27name%27;?\>&action=<?php%20echo%20;?\>
can you anybody help me?
Edit 2
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo '<th><a href="members.php?id='.$row['name'].'&action=' . $action . '">Name</a></th>';
while($row = $result->fetch_assoc()) {
echo '<td> ' . $row['name'] . '</td>';
Undefined variable: 'row'
can you help me?