如何使用ajax为数据库添加新输入和更新值

i have a database Included 3 columns " name " , " barcode " , " price " and have a form like blow :

http://i.stack.imgur.com/MwHIw.jpg

i want when user fill the barcode input and press " Enter " key do form like below pic :

http://i.stack.imgur.com/KPuXv.jpg

and the input names have be like blow :

<HTML> 
  <form action="do.php" method="Post">
    name : <input name="name[]" type="text" />
    barcode: <input name="barcode[]" type="text" />
    price : <input name="price[]" type="text" />
  </form>
</HTML>

--- Update 1 ---

  1. Jquery Source
    <script type="text/javascript">
        $(document).ready(function(){
            $("#text").keyup(function(){
                var key = $("#text").val();
                var active = true;
                $.post("search.php",{key:key,active:active},function(data){
                    $("#result").html(data);
                });
            });
        });
    </script>

<?php
include "config/connect.php";
    if(isset($_post["active"]) && $_post["key"])
    {
        $key = $_post["key"];
        $sql = "SELECT * FROM `product_list` WHERE `barcode` LIKE :title ";
        $result = $connect->prepare($sql);
        $k = "%".$key."%";
        $result->bindParam(":title",$k); // ----> i have a error here ! <----
        if($result->execute())
        {
            if($result->rowCount()>0)
            {
                while($rows=$result->fetch(PDO::FETCH_ASSOC))
                {
                    echo $rows["name"]."<hr />";
                    echo $rows["barcode"]."<hr />";
                    echo $rows["price"]."<hr />";
                }
            }
            else
            {
                echo "i can't fount anything . please try another barcode";
            }
        }
        
        
    }
?>

How echo result in a new inputs ?! how Fix error ?! what is problem ?!

</div>

Add more information here. Show what you have already written in PHP.. You tagged php and such, but what you are asking for is lots of basic info on the web..

Show us how far you are with coding, then we can help. Without you doing anything except html code, people here aren't going to help u.. no offense.