Am getting data from database and its being echoed as shown below.it works fine
<?php
include 'retrieveAllPosts.php';
foreach ($studentsResults as $posts)
{
$title = htmlentities($posts['Title']);
$Location = htmlentities($posts['Location']);
$Description= htmlentities($posts['Description']);
$companyname = htmlentities($posts['companyname']);
echo "
<div class='col-md-6 z-depth-1-half' style='margin-left:250px; margin-top:10px;margin-bottom: 10px' id='hey'>
<h3>$title</h3>
<p name='location'>$Location</p>
<h6><b>Description</b></h6>
<p>$Description</p>
<p>$companyname</p>
<form action='showPosts.php' method ='POST'>
<button class='btn btn-primary' type='submit'>Apply</button>
</form>
</div>
";
}
?>
many divs according to the number of records in the database are displayed.How can i get the location and description data when the user clicks the submit button of a only that div and send it to showposts.php. The same should occur for all the other divs.