Fetch different data from the database for every list item which opens the same page
<p>I have an index.php file and a details.php file, both of which retrieves data from the same table, products.
The index.php file shows a list of name of products using</p>

<pre><code>$result = $mysqli-&gt;query('SELECT name FROM products');
if($result)
{
while($obj = $result-&gt;fetch_object()) 
{   
     echo '&lt;li&gt;&lt;a href="details.php&gt;'.$obj-&gt;name.'&lt;/a&gt;&lt;/li&gt;';
}
}
</code></pre>

<p>Now in details.php, i only want to display the details of the product whose name i clicked on. How do I achieve this?</p>