I have a problem and I don't know how to resolve...
I have page with comments and page with replies.
Down is my code, everything is ok, it shows all I want but the problem is, when I click on the comment to go to the page with a reply, the id it gets is wrong.
Example: for the first comment I need to have id=1, second id=2 etc. But I get id=1 for all the comments where user_id = 1 and not id from comment.
Sorry, my English.
$id = $show['id'];
$sq = "SELECT * FROM comments, users WHERE comments.user_id = users.id";
$re = mysqli_query($dbCon, $sq);
<div class="card hoverable q_area">
<img src="<?php echo $show['profile_foto'] ?>">
<?php echo $abc['user'] . " said:"; ?>
<?php $a=substr(str_replace(' ','-',$abc['question']), 0, 50); ?>
<h5><a href="replys.php?id=<?php echo $abc['id'] ?>&reply=<?php echo $a ?>">
<?php echo $abc['comment']; ?></a></h5> <br />
<?php } ?>
$sq = "SELECT * FROM comments";
users - id, user, pass
comments- id, user_id, comment
query - $sq to this one:
$sq = "SELECT a.*, b.user FROM comments as a, users as b WHERE a.user_id = b.id"