<There is a source> After running the application, enter it in the membership registration box and check the web hosting database, the value is saved to 0. (You have added a PHP file.)

Asked 2 years ago, Updated 2 years ago, 91 views

I made a login form by connecting the DB through web hosting, and it works well. After that, welcome, "Fan ID." It says "0" in the department of "xxxxxxxx". The name and school number are exactly the values entered at the time of membership registration and are also printed in the database. By the way, why is the name of the department entered as 0 in the database identified by phpmyadmin and output as 0 value even when running the application? Korean names are saved accurately and appear well on screen output. By the way, I changed the original age entry (int) to the department name input and modified all the java files (intage part as String), sqlite php files, and DB (int->vachar). What's the problem? Is there anything else that needs to be fixed?

Here, the variable that Stn takes the course.

This is the screen that you print out when you log in successfully.

    TextView tvWelcomeMsg = (TextView) findViewById(R.id.tvWelcomeMsg);
    EditText etUsername = (EditText) findViewById(R.id.etUsername);
    EditText etStn = (EditText) findViewById(R.id.etStn);

    // // Display user details
    Welcome to SSARI, String message = name+.";
    tvWelcomeMsg.setText(message);
    etUsername.setText(username);
    etStn.setText(stn);
}

}

.etUsername);
        final EditText etPassword = (EditText) findViewById(R.id.etPassword);
        final Button bRegister = (Button) findViewById(R.id.bRegister);

        bRegister.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                final String name = etName.getText().toString();
                final String username = etUsername.getText().toString();
                final String stn = etStn.getText().toString();
                final String password = etPassword.getText().toString();

This is the part that connects with the database. I'll change the web hosting address slightly.

public class RegisterRequest extends StringRequest {
    private static final String REGISTER_REQUEST_URL = "http://.com/Register.php";
    private Map<String, 
        params.put("password", password);
        params.put("stn", stn);
    }

What's the problem? Why do they keep recognizing department columns as numbers? If you enter a number at the time of subscription, it will be printed as it is. Zero is stored in the database and output as zero only when the character is entered.Help me.

sqlite database php android

2022-09-21 15:19

1 Answers

http://php.net/manual/kr/mysqli-stmt.bind-param.php

Try the second parameter as "ssssss"
I think you can check if the type that stores the value of db is string (varchar, etc.).


2022-09-21 15:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.