title: Save my cookie data to MySQL database?
body: <p>I was doing a survey I was offline server so I save users information in cookies,
  I have users Information like this </p>
  
  <p><strong>Fname:Ali,Lname:Kheiri,title:Director,org:Magiclamp,email:alikheiri@gmail.com
  Fname:Ali,Lname:Kheiri,title:Director,org:Magiclamp,email:alikheiri@gmail.com</strong> </p>
  
  <p>it is save in cookies, but now i am online, so i want to save this cookies data in mysql database in php, javascript for this I write this code but its not working </p>
  
  <pre><code>    mysql_connect("localhost","root","");//database connection05
      mysql_select_db("o2measure");
      if($_POST['submit']){
          $date = date('Y,m,d');
         $time = date("i:h:s",time() + $time_a);
         echo $session_id;
         $ip=$_SERVER['REMOTE_ADDR'];
          foreach($_COOKIE as $name =&gt; $cookie){
      // you can check any conditions based on cookie name $name
      $sql="INSERT INTO user_data (first_name, last_name, job_title, organisation, email, phone_number, ip_address, date, time)
       VALUES(" . mysql_escape_string($cookie) . ")";
          $result=mysql_query($sql); 
  
  }
  </code></pre>