无法获取名称,用户名和密码

时间:2015-08-23 14:38:10

标签: php mysql

当我尝试登录时,显示不正确的用户详细信息。虽然数据已插入但未获取。 以下是我的两个PHP文件。

Register.php

sorted

FetchUserData.php

<?php

$con=mysqli_connect("mysql.hostinger.in","name","password","u721174658_swap");


$name = $_POST["name"];

$username = $_POST["username"];
$password = $_POST["password"];

$statement = mysqli_prepare($con, "INSERT INTO `user` (name,username, password) VALUES (?, ?, ?)");
mysqli_stmt_bind_param($statement, "sss", $name,$username, $password);
mysqli_stmt_execute($statement);



mysqli_stmt_close($statement);

mysqli_close($con);
?>

1 个答案:

答案 0 :(得分:0)

用于获取以下方式和会话开始

    while($row= mysql_fetch_array($statement){
    $name = $row['name'];
}