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 8453075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:40:28+00:00 2026-06-10T11:40:28+00:00

I can get data from MySql with use of php using android successfully. But

  • 0

I can get data from MySql with use of php using android successfully. But i m getting some problem with inserting record in mysql table using php-android.

This is my .php file:

 <?php
     mysql_connect("localhost","root","");
     mysql_select_db("database_name");
     $sql=mysql_query("insert into table_name values('".$_REQUEST['s_name']."')");
     $r=mysql_query($sql);
      if(!$r)echo "Error in query: ".mysql_error();mysql_close();
 ?>

This is my android activity’s onCreate method’s content.

    ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
    nameValuePairs.add(new BasicNameValuePair("s_name","StackOver"));

   try{ 
       HttpClient httpclient = new DefaultHttpClient();
       HttpPost httppost = new HttpPost("http://10.124.238.51PH/get_cities_names.php");
       httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
       HttpResponse response = httpclient.execute(httppost);
       HttpEntity entity = response.getEntity();
       is = entity.getContent();

     }catch(Exception e){
          Log.v("log_tag", "Error in http connection "+e);
     }

Here i want to pass BasicNameValuePair(“s_name”,”StackOver”)) s_name to .php but it can’t be possibel. please give me some idea or links of tutorials. I have search in ner so much but i can’t find proper tutorial for this.
Thank you in advance.

  • 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-10T11:40:30+00:00Added an answer on June 10, 2026 at 11:40 am

    Here is the tutorial for saving data and passing data. Watch it, Learn from it and then create.

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

Sidebar

Related Questions

If possible, how can I get (and post) data from a mysql database using
I initially create a table using some data loaded from a php mySQL query.
How can I get ALL the data from a table of my DB (mySQL)
Using LINQ can I get the data from the table into the format shown
I found that PageProxy can be used to get data from page, but I
I am having a problem writing a MySQL query to get data from 2
I'm looking to store some fairly sensitive data using PHP and MySQL and will
I'm trying to use jQuery.post() function to retrieve some data. But i get no
How can we get data from the server in an asynchronous way in Flash?
Can I get compressed data from cvCapture, which is stored into buffer after cvGrabFrame,

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.