jquery link with MySQL - full code
<p>I am stuck, my code should manage contacts and be able to alter them. </p>

<p>I would like to click to the Name1, Name2, Name3 and be able to see on the right hand side and be able to submit/save it in my SQL DB.</p>

<pre><code>&lt;?php 
include("db_con1.php"); 

// left side people list
$peoplelist='SELECT contact_first, contact_sur, contact_mobil FROM contactmain WHERE status=1';
$queryl = $pdo-&gt;prepare($peoplelist);
$queryl-&gt;execute();
?&gt;


&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"&gt;

&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;Email sending program&lt;/title&gt;
  &lt;link rel="stylesheet" type="text/css" href="css/adminolok.css"&gt;
  &lt;link rel="stylesheet" type="text/css" href="css/menu.css"&gt;

  &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"&gt;&lt;/script&gt; 
  &lt;script&gt;
  $('leftnavigation a.names').click(
    var thisId = $(this).attr('id');
    $('.midtop input').val( $(this).html() + $(this).attr('id'); );
  &lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;?php include("menu.php"); ?&gt;

&lt;div id="leftnavigation"&gt;
&lt;ul&gt;
&lt;?php foreach ($queryl as $i =&gt; $rowl) { ?&gt;
&lt;li &gt;
  &lt;a href="#" class="names" id="&lt;?php echo $i; ?&gt;"&gt;
    &lt;span class="name"&gt;
     &lt;?php echo $rowl['contact_first'].' &lt;strong&gt;'.$rowl['contact_sur'].'&lt;/strong&gt;'; ?&gt;
    &lt;/span&gt;
    &lt;br /&gt;
    &lt;span class="mobil"&gt;&lt;?php echo $rowl['contact_mobil'];?&gt;&lt;/span&gt;
  &lt;/a&gt;
&lt;?php  }?&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;


&lt;div id="midtop"&gt;
 Change your name: &lt;input type="text" name="name" /&gt;

&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>As I am getting more and more help I feel that I will be... but it is still full of bug as it doesn't work yet.  Any help would be really appreciated.</p>

<p>Made some alteration as I've been taught to do so:)))) thanks for that</p>
