Register/Login Notworking android/PHP -


hi guys set table on 000webhost. set column id, name, username, age , password. reason username not show in table when run code register , im not sure error is. here code register.php:

<?php $con = mysqli_connect("*****", "****", "*****", "****");  $name = $_post["name"]; $age = $_post["age"]; $username = $_post["username"]; $password = $_post["password"];  $statement = mysqli_prepare($con, "insert user (name, username, age, password) values (?, ?, ?, ?)"); mysqli_stmt_bind_param($statement, "siss", $name, $username, $age, $password); mysqli_stmt_execute($statement);  $response = array(); $response["success"] = true;    echo json_encode($response); ?> 

as stated in comments:

you're trying insert string using i parameter being integer.

the order matters when binding.

you need change present parameters ssis while making sure age column indeed integer type.

checking errors on query have told it.

i hope you're not storing plain text passwords. use password_hash() if plan on going live this.

sorry bearer of bad news, hacked should case.

using prepared statement without using safe password hashing function won't guarantee site being compromised.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -