escape all values? but thats the part that is working, here is the sample code ive been working with
<!DOCTYPE HTML>
<html>
<head>
<script>
$(function () {
$('#track-link').click(function () {
alert('holla');
alert('This is the track: ' + $(this).data('track'));
});
});
</script>
</head>
<body>
<?php
$con=mysqli_connect("localhost","root","","mnjush");
$result = mysqli_query($con,"SELECT * FROM music");
while($row = mysqli_fetch_array($result)) {
echo $row['artist'] ;
?>
<a id="track-link" href="<?php echo $row['trackLoc']; ?>" download="<?php echo $row['trackLoc']; ?>"
data-track="<?= htmlspecialchars($row['trackLoc'], ENT_QUOTES, 'UTF-8') ?>">Download</a>
<?php
echo "<br>";
}
mysqli_close($con);
?>
</body>
</html>