So i have a selection of divs that get generated from and sql query.
while ($row = mysqli_fetch_assoc($result)) {
// echo '<p class="data" >';
foreach( $row AS $key=>$value)
{
if ($key == "CodeID"){
$CodeID=$value;
}
if ($key == "EventName"){
$count +=1;
// Use CodeId instead of Count
echo "
<div class='TheDiv' onclick='Expand()' style='order:".$count."'>
<a href='?E=".$CodeID."'><p> ".$value."</p></a>
</div>
";
}
When a user clicks on one i want the "CodeID" to be stored in someway so then later i can use it to display a form:
If(ISSET($_GET["E"])){
$ID=$_GET["E"];
$_SESSION['varname'] = $ID;
$query = "SELECT * FROM `qrcode` WHERE `CodeID` =".$ID.";";
$result = $SQLConnection->RunMySQLi($query);
while ($row = mysqli_fetch_assoc($result)) { //looping through the returned SQL rows one at a time
echo '<p class="data" >';
Right now i do this with Href and passing ?E, but that reloads the page and my js animation from the "onClick" does not finish as the page reloads, can someone help me please
Thank you!
You could probably store information using the $_SESSION variable, Have you checked into javascript XHR ?
Maybe is that a solution to your problem