I created a data through an *insert page* where data will be inserted using ***mysql***.
When I try to fetch the new inserted data, it won't fetch the data.

For example:

```
INSERT INTO bag(bid,bookno,name) VALUES ('','$bn','$n');

```

My data supposedly:

```
           bid   bookno     name
            1      23      mystery
            2      56      mystery
            3      89      mysteryy

```

When I fetch the *name* column, it fetches the *name="mystery"* smoothly, but it cannot fetch the *name ="mysteryy"* data which is just recently inserted to my database.

My fetch query is...

```
SELECT * FROM bag WHERE name='$name';

```

Where `$name=$_POST['nam'];`

This is my **HTML** code:

```
<td><input type="checkbox" name="chk[]"/></td>
<td><input type="text" name="bookno[]" id="bookno" /></td>
<td><input type="text" name="nam[]" id="nam" /></td>

```

The **PHP** insert code:

```
foreach($_POST['nam'] as $row=>$pro)
{
    if($pro!="")
    {
    $n=$pro;
    $bn=$_POST['bookno'][$row];
    }
}

$s=INSERT INTO bag(bid,bookno,name) VALUES ('','$bn','$n');

```