title: how to store session in single field of mysql seperated by commas?
body: <p>Hi I want to store session of user in single field of mysql right now I'm doing in this way but its not working how can I do so?
  And secondly how can I retrieve that single field to check if user exsits in it or not?</p>
  
  <pre><code>    &lt;?php session_start();
      if (!isset($_SESSION['uid']))
      ?&gt;
      &lt;body&gt;
      &lt;?php $uid=$_SESSION['uid'];
        $values[] = $uid;
        $whyus = implode(",",$values);
        $whereclase= " where mainentry.id=".$_GET['id'];  
        $sql = "INSERT INTO mainentry (viewed_list) VALUES ('$whyus')"."$whereclase"; 
        mysql_query($sql);
  ?&gt;
  </code></pre>