Everytime I try to do this, the URL shows up like this: ?id=
. The id is empty. Here is what I did:
echo '<a href="#small?id="'.$row['id'].'"" id="smallbtn" data-toggle="modal" data-modal="small">';
And for the modal:
<div class='modal fade' id='small?id=<?php <-- Here is what is used to call the #small
$username = $_SESSION['username'];
$db = mysqli_connect("localhost", "root", "password", "testdb");
$sql = "SELECT * FROM user WHERE username = '$username' ORDER BY id DESC";
$result = mysqli_query($db, $sql);
while ($row = mysqli_fetch_array($result)) {
echo '"'.$row["id"].'"';
}
?>' role='dialog'></div>
Also what happened is that nothing shows up when I click the href. I think it has something to do with how I setup up the modal code above. When I checked for other questions similar, I read that PHP GET Method is not dynamic so that might be the issue as well. Is there a way I can fix this problem?
UPDATE: The URL shows correctly, but the modal does not display.