Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7945173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:46:55+00:00 2026-06-04T00:46:55+00:00

I was doing a survey I was offline server so I save users information

  • 0

I was doing a survey I was offline server so I save users information in cookies,
I have users Information like this

Fname:Ali,Lname:Kheiri,title:Director,org:Magiclamp,email:alikheiri@gmail.com
Fname:Ali,Lname:Kheiri,title:Director,org:Magiclamp,email:alikheiri@gmail.com

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

    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 => $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); 

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:46:57+00:00Added an answer on June 4, 2026 at 12:46 am

    you should get the cookie value as a string split it and have every criteria alone than use the insert query because the query you wrote is incorrect you saying insert into user_data the first name the last name the job title… but you are only giving him 1 value the $cookie but the sql don’t know that the $cookie contain everything so you should first slpit the cookie value based on the ‘,’

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML structure that looks like this: <?xml version=1.0?> <survey> <responses>0</responses> <question>
I have a StaffLookup table which looks like this. UserSrn | UserName | ManagerSrn
Doing something like this: from zipfile import ZipFile #open zip file zipfile = ZipFile('Photo.zip')
Doing Android development on a Mac and this very new phone I have doesn't
I'm doing a survey of features in preparation for a research project. Name a
Doing some jquery animation. I have certain divs set up with an attribute of
I have a bunch of optional write-in values for a survey I'm working on.
I'm not sure if I'm doing something wrong or if this is a bug
I have a set of data which defines ratings in a survey table for
I'm tasked with implementing a survey addition to an existing website. We have been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.