jQUery PHP pass the value to ajax i just need the id to edit the file
<p>how can i get the value of id from my database using jQuery AJAX.</p>

<p>I created an CRUD which i need to edit and delete the user for each respected id
the Create New user was working because i dont need the id to pass.
But when i do the update the user the value of ID was not working for each user.</p>

<p>it only read the first ID but the rest of the user cannot be read anymore.
I have this code</p>

<pre><code>&lt;form method="get"&gt;
&lt;table class="table table-bordered"&gt;
&lt;?php 
$sqlView = mysql_query("SELECT * FROM user ORDER BY id DESC") or die (mysql_error());
while($rowView = mysql_fetch_array($sqlView)){
$id = $rowView['id'];
echo '
&lt;tr&gt;
    &lt;td&gt;
        &lt;input type="hidden" name="id" value="'.$id.'" /&gt;
        &lt;input type="hidden" name="name" value="'.$rowView['name'].'" /&gt;
        &lt;input type="hidden" name="up" value="edit" /&gt;
        '.$rowView['name'].'
    &lt;/td&gt;
    &lt;td&gt;'.$rowView['phone'].'&lt;/td&gt;
    &lt;td&gt;'.$rowView['address'].'&lt;/td&gt;
    &lt;td&gt;'.$rowView['email'].'&lt;/td&gt;
    &lt;td&gt;'.$rowView['status'].'&lt;/td&gt;
    &lt;td&gt;&lt;a href="#" class="update" id="'.$id.'"&gt;Update&lt;/a&gt; Delete &lt;/td&gt;
&lt;/tr&gt;
';
}

?&gt;
&lt;/table&gt;
&lt;/form&gt;

$('a.update').click(function(e) {
    $('&lt;img src="images/loading.gif" id="loading" style="width:auto;" /&gt;').appendTo(".span9");
    //Cancel the link behavior
    e.preventDefault();
    //Get the A tag
    var id = $( 'input[name=id]' ).val();
    var edit = $( 'input[name=up]' ).val();
    var name = $( 'a#id' ).val();
    alert( name );
    $.ajax({
        type:"GET",
        url:"ajax/company.php",
        data: {id: id, up: edit, aid: name},
        dataType: 'html',
        target: '.span9',
        success: function(data){
            $(".span9").find('img#loading').remove();
            $(".span9").html(data);
        }
    })
}); 
</code></pre>

<p>the ajax/company.php</p>

<pre><code>&lt;?
echo $_GET['id'];
?&gt;
</code></pre>

<p>is my ajax wrong?</p>

<p>why is it on while the jQuery cannot pass the value of each id.</p>
