PHP online store, looping buttons & databases : <p>So I am writing this code and I want to make it by getting the data of the database using a loop. The problem that I got is that I can't seem to find a way to push through a value to the database from the buttons that I got. I am open to ideas. Thanks !</p>

<pre><code>&lt;!Doctype HTML&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;link rel="stylesheet" href="style.css" type="text/css"/&gt;
    &lt;title&gt;Online Catalog&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form action="" method="get"&gt;

&lt;?php 
session_start();
require('database.php');

echo "&lt;h1&gt;&lt;a href=". 'index.php' ."&gt;Catalog&lt;/a&gt;&lt;/h1&gt;
&lt;b id=".cart."&gt;&lt;a href=". 'cart.php' ."&gt;Show cart&lt;/a&gt;&lt;/b&gt;";

if ($result = $connection-&gt;query("SELECT * FROM `store`")) {
    $row_cnt = $result-&gt;num_rows;
    while ($row = $result-&gt;fetch_assoc()) {
        echo "&lt;p&gt;
            &lt;table&gt;
                &lt;th&gt;
                    &lt;img src=".$row[img_path].'/'.$row[img_name]."&gt;
                &lt;/th&gt;
                &lt;td&gt;
                    &lt;h2&gt;". $row[name] ."&lt;/h2&gt;&lt;br&gt;
                    ". $row[description] ."&lt;br&gt;&lt;br&gt;
                    Price : ". $row[price] ."$&lt;br&gt;
                &lt;/td&gt;
                &lt;td &gt;
                    &lt;input type='submit' name='add".$row[id]."' value='Add to cart'/&gt;
                &lt;/td&gt;
            &lt;/table&gt;
        &lt;/p&gt;
        ";

        if(isset($_GET['add.$row[id].'])){
            $cart=1;
            if(mysqli_query($connection, "INSERT INTO `store-project`.`store` (`incart`) VALUES ('$cart')")){
                mysqli_close($connection);
                header("Location: cart.php");
            }   
        }
    }


    $result-&gt;close();
}
?&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p><a href="http://i.stack.imgur.com/9HJdg.png" rel="nofollow">Here is the database</a></p>

<p><a href="http://i.stack.imgur.com/cr58y.png" rel="nofollow">And here is how it generally looks</a></p>
