Results 1 to 3 of 3
  1. #1

    Unhappy Androdid communication with mysql php login script

    Dear Sirs and Madams!

    I am trying to login into mysql database on some server from my Galaxy Note mobile device (Android 2.2.6). Now, once i execute post in following code:
    private void loginToDatabase(final String strUsername,
                                       final String strPassword)
                HttpClient client=new DefaultHttpClient();
                HttpPost post=new HttpPost("myserver/php/login.php");
                HttpResponse response=null;
                List<NameValuePair> loginInfo=new ArrayList<NameValuePair>(2);
                loginInfo.add(new BasicNameValuePair("username",
                loginInfo.add(new BasicNameValuePair("password",
                post.setEntity(new UrlEncodedFormEntity(loginInfo));
            catch(Exception e)
                int i=0;
            }   // try-catch-finally
        }   // loginToDatabase
    and once I watch response variable in debug session, the response object holds "Internal Server Errror (500).". Here is my php script:
    PHP Code:

    $hostname_localhost ="localhost";
    $database_localhost ="database";
    $username_localhost ="user";
    $password_localhost ="password";
    $password_localhost) or die(mysql_error());

    #echo "Connected to Server.<br/>";

    mysql_select_db($database_localhost) or die(mysql_error());

    #echo "Connected to Database.<br/>";


    $query_user=mysql_query("SELECT id_customer, lastname, firstname FROM ps_customer WHERE email=$username AND passwd=$password";
    "User found.<br/>";
    "User not found.<br/>;
    Why am I getting this error?

  2. #2

    recall a similar solution

    From someone at digitalplayground. With a android login to a MySQL database for file sharing and other.

  3. #3
    I solved it, on demand I can send a code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts