私はこの不思議なバグを抱えていましたが、基本的には私がAndroid上にこのアプリケーションを持っていて、新しい "ユーザー" (「連絡先ヘルプ」と呼ばれる)の値が時々間違っている、奇妙な部分はここに、それは完全にランダムに起こるということである私の.phpがPHP MySQLデータベースの間違った情報を投稿する(PHP + MySQL)
<?PHP
$con=mysqli_connect("localhost","root","","proyecto");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
if(isset($_POST['txtNombre']) && isset($_POST['txtcontactousuarionuevo']) &&
isset($_POST['txtPass']) && isset($_POST['txtprograma'])){
$nombreestudiante = $_POST['txtNombre'];
$contactoestudiante = $_POST['txtcontactousuarionuevo'];
$passestudiante = $_POST['txtPass'];
$programa = $_POST['txtprograma'];
$query = "INSERT INTO estudiante(Nombre, Contacto, Id_Periodo_FK, Pass)
VALUES ('$nombreestudiante', $contactoestudiante, 4, '$passestudiante');";
$query .= "INSERT INTO estudiante_programa(EstudianteE_P_FK, ProgramaE_P_FK)
VALUES(LAST_INSERT_ID(), $programa)";
$result =mysqli_multi_query($con,$query);
if($result > 0){
if(isset($_POST['mobile']) && $_POST['mobile'] == "android"){
echo "success";
exit;
}
echo "Insert Successfully";
}
else{
if(isset($_POST['mobile']) && $_POST['mobile'] == "android"){
echo "failed";
exit;
}
echo "Something Error";
}
}
?>
<html>
<head><title>Insert | ProyectoBD</title></head>
<body>
<h1>Insert ProyectoBD| <a>Santiago Troitiño C - 201421697</a></h1>
<form action="<?PHP $_PHP_SELF ?>" method="post">
Nombre <input type="text" name="txtNombre" value=""/><br/>
Contacto <input type="text" name="txtcontactousuarionuevo" value=""/><br/>
Pass <input type="text" name="txtPass" value=""/><br/>
<input type="submit" name="btnSubmit" value="Insert"/>
</form>
</body>
である私のアプリは、ログイン画面とボタンがありますそのページ(Loginページ)で実行された.phpは次のようになります:
<?PHP
include_once("connection.php");
if(isset($_POST['txtUsername']) && isset($_POST['txtPassword'])){
$username = $_POST['txtUsername'];
$password = $_POST['txtPassword'];
$query = "SELECT * FROM estudiante WHERE Nombre = '$username'
AND Pass = '$password'";
$result = mysqli_query($conn, $query);
if($result->num_rows > 0){ //has record. correct username and password
echo "success";
while($row = $result->fetch_assoc()) {
echo " ". $row["Id_Estudiante"]. "";
exit;
}
exit;
}
else{
echo "Wrong username and password";
exit;
}
exit;
}
?>
<html>
<head><title>Login | ProyectoBD</title></head>
<body>
<h1>Login ProyectoBD | <a>Santiago Troitiño C - 201421697</a></h1>
<form action="<?PHP $_PHP_SELF ?>" method="post">
Nombre <input type="text" name="txtUsername" value="" placeholder="Ingresar Nombre" /><br/>
Password <input type="password" name="txtPassword" value="" placeholder="Ingresar Pass" /><br/>
<input type="submit" name="btnSubmit" value="Login"/>
</form>
</body>
</html>
者はアプリのこの部分にexcuted唯一の.phpです... As you can see on this image the number "2147483647" keeps appearing at complete random times, I used that number for a register once but kkeps appearing
私はこの問題を解決する方法の任意のアイデアは?ありがとう!
データ型はintで、Androidアプリケーションでは制限されているため、数字以外の文字は使用できません。 –
データタイプが変更されましたが、今はうまくいくようです。ありがとうございます! ^^ –
優れています。どういたしまして – xec86