i have this code to select some info from database to ul and open it in new window by id , the problem here is the same row open in the new window even i clicked in another title , i just want if user click in title will open new window with the info from the same row in database and if user click another title will open another window withe info from the same row :
<div class="col l6 offest-13">
<?php
$sql = "SELECT * FROM post";
$result = mysqli_query($conn, $sql);
if(mysqli_num_rows($result) > 0){
while($row = mysqli_fetch_assoc($result)){
?>
<ul class="collection" >
<li class="collection-item" >
<h3><a id="a" value="submit" name="submit" href="" ><?php echo
$row['title'];?></a></h3>
<span class="grey-text">by <?php echo $row['author'];?> on <?php echo
$row['publish_date'];?></span>
<br>
<button class="button" id="submit" name="submit" value="submit"><span
class="s_text">GET COINS</span></button>
<div class="time-views">
<span class="time"><?php echo $row['type'];?>s<i class="material-
icons">access_time</i></span>
<span class="views"><?php echo $row['views'];?><i class="material-
icons">visibility</i></span>
</div>
</li>
</ul>
<script type="text/javascript">
$( "#a" ).click(function(){
window.open("createdb.php?id=<?php echo $row['id'];?>","ASDF") ;
});
</script>
<?php
}
}
?>
</div>