当行内容来自数据库时,在按钮单击上动态添加表行

hi i am working on a form which will dynamically generate a table row when a user clicks on the the add button but the problem is i am loading the row to be generated from an external php file but it not seems to work i am using an external file because the row will contain a combo box will which will be populated by mysql data can anyone help me in this here is my script

$(document).ready(function() {
    //var currentItem = $('#items').val();
    $('#addnew').click(function(){
        var ctr = $('#items').val();
        ctr++;
        $.post('purch_srch.php', {ctr : ctr}, function(data) {
            $(data).appendTo('#data')
            $('#items').val(ctr);                        
        });
    }); 
});

here is my php

<?php
session_start();

require("includes/dbconnect.php");
include ('includes/function.php');

mysql_select_db($_SESSION["zdbname"]);

if (isset($_POST['ctr'])) {
    $ctr = $_POST['ctr'];

    echo '<tr>';

    echo '<td align="center"><input type="text" size="6" maxlength="6" maxlength="6" name="ord_'.$ctr.'" class="form-input-oth"/></td>';
    echo "<td>";
    echo '<select data-placeholder="Party" style="width:120px;" name="item_'.$ctr.'" class="chzn-select-deselect" >';
    echo "<option value = '' ></option>";
    $get = mysql_query("SELECT * FROM accmast WHERE `grpcode`='010'") or die(mysql_error());
      while($cc = mysql_fetch_array($get)){
            echo "<option value=$cc[accode]>$cc[name]</option>";
      }
    echo "</select></td>";
    echo '<td align="center"><input type="text" size="6" maxlength="9" maxlength="6" name="descrip_'.$ctr.'" class="form-input-name"/></td>';
    echo '<td align="center"><input type="text" size="6" maxlength="9" maxlength="6" name="unit_'.$ctr.'" class="form-input-rate"/></td>';
    echo '<td align="center"><input type="text" size="6" maxlength="9" maxlength="6" name="totqty_'.$ctr.'0" class="qty form-input-rate"/></td>';
    echo '<td align="center"><input type="text" size="6" maxlength="9" maxlength="6" name="rate_'.$ctr.'" class="rate form-input-rate"/></td>';
    echo '<td align="center"><input type="text" size="6" maxlength="9" maxlength="6" name="amt_'.$ctr.'" class="cal  form-input-amt"/></td>';
    echo "</tr>";
}
else{
    echo "ERROR";
}

here is my table

<table border="1px" width="90%" id="data">
    <tr>
        <td><br /></td>
    </tr>
    <tr>
        <td width="130px" align="center"><label for=""><font color="#0099FF" size="3px">Order</font><span></span></label></td>
        <td width="130px" align="center"><label for=""><font color="#0099FF" size="3px">item</font><span></span></label></td>
        <td width="130px" align="center"><label for=""><font color="#0099FF" size="3px">Description</font><span></span></label></td>
        <td width="130px" align="center"><label for=""><font color="#0099FF" size="3px">Unit</font><span></span></label></td>
        <td width="130px" align="center"><label for=""><font color="#0099FF" size="3px">Total Quantity</font><span></span></label></td>
        <td width="130px" align="center"><label for=""><font color="#0099FF" size="3px">Rate</font><span></span></label></td>
        <td width="130px" align="center"><label for=""><font color="#0099FF" size="3px">Amount</font><span></span></label></td>
    </tr>
    <tr>
        <td align="center"><input type="text" size="6" maxlength="6" maxlength="6" name="ord_0" class="form-input-oth"/></td>
        <td align="center">
            <select data-placeholder="Party" style="width:120px;" name="order" class="chzn-select-deselect" >
                <option>rehan</option>
            </select>
        </td>
        <td align="center"><input type="text" size="6" maxlength="9" maxlength="6" name="descrip_0" class="form-input-name"/></td>
        <td align="center"><input type="text" size="6" maxlength="9" maxlength="6" name="unit_0" class="form-input-rate"/></td>
        <td align="center"><input type="text" size="6" maxlength="9" maxlength="6" name="totqty_0" class="qty form-input-rate"/></td>
        <td align="center"><input type="text" size="6" maxlength="9" maxlength="6" name="rate_0" class="rate form-input-rate"/></td>
        <td align="center"><input type="text" size="6" maxlength="9" maxlength="6" name="amt_0" class="cal  form-input-amt"/></td>
    </tr>
    <input type="button" id="addnew" class="classname" name="addnew" value="+" /> 
    <input type="hidden" id="items" name="items" value="1" />

Are you sure about that? $(data).appendTo('#data') ??

Try that $('#data').appendTo(data);