I am new to this web development kind of thing. This is really driving me crazy over the past week. I want to populate my form inside my modal, I've been reading forums and tutorials to no avail. I read that you need something like AJAX which I have no experience with so if the answer's within that field I would really appreciate it if you can explain it to a beginner like me.
\*\* Anyway here is my table\*\*

```
    <table class="table table-striped table-bordered">
                    <thead>
                        <tr>
                            <th style="text-align:center;"> ITEM CODE </th>
                            <th style="text-align:center;"> NAME </th>
                            <th style="text-align:center;"> SIZE </th>
                            <th style="text-align:center;"> COLOR </th>
                            <th style="text-align:center;"> ACTION </th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php
                        include('connect.php');
                        $result = mysql_query("SELECT * FROM products");
                        while($row = mysql_fetch_array($result))
                            {
                                echo '<tr>';
                                echo '<td style="text-align:center;">'.$row['itemcode'].'</td>';
                                echo '<td style="text-align:center;">'.$row['name'].'</div></td>';
                                echo '<td style="text-align:center;">'.$row['size'].'</div></td>';
                                echo '<td style="text-align:center;">'.$row['color'].'</div></td>';
                                echo '<td style="text-align:center;"><a data-toggle="modal" data-target="#myModal" href="#">EDIT</a></td>';
                                echo '</tr>';
                            }

                        ?> 
                    </tbody>
    </table>

```

I have an edit button linking to my modal on that last td tag right there.

**Now here is my modal**

```
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="largeModal" aria-hidden="true">
        <?php
        include('connect.php');
        $itemcode=$_GET['itemcode'];
        $result = mysql_query("SELECT * FROM products where itemcode='$itemcode'");
        while($row = mysql_fetch_array($result))
            {
               $name=$row['name'];
               $size=$_GET['size'];
               $color=$_GET['color'];
            }
        ?>      

         <div class="modal-dialog modal-sm">
            <div class="modal-content">
              <div class="modal-header">
                 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                     <h1 class="modal-title" id="myModalLabel">Edit Products</h1>
              </div>
              <div class="modal-body">
                 <input type="text" class="form-control input-sm" placeholder="Product name" value="<? echo $name;?>"></input>
                 <input type="text" class="form-control input-sm" placeholder="Product size" value="<? echo $size;?>"></input>
                 <input type="text" class="form-control input-sm" placeholder="Product color" value="<? echo $color;?>"></input>
              </div>
              <div class="modal-footer">
                    <a href="searchresult.php" class="btn btn-primary btn-lg">DO IT!</a>
              </div>
            </div>
         </div>
    </div>

```

I am probably doing this the wrong way and I am probably missing something fundamental. If anyone will help please kindly explain to me what you did I am still not use to web developing. Thanks.