douyong8801 2017-09-08 02:39
浏览 108
已采纳

“警告:mysqli_stmt_bind_param()要求参数1为mysqli_stmt,布尔值在”

I'm getting these warnings from web host which contains my database. I'm trying to get an android app developed in Android studio to send data from a Register user activity to a database. I think I'm having a PHP Script error..

Below is my PHP code for registering user:

<?php
$con = mysqli_connect("localhost", "user", "pass", "db");

if (isset($_POST["name"], $_POST["email"], $_POST["username"], $_POST["password"])) 
{
$name =     $_POST["name"];
$email =    $_POST["email"];
$username = $_POST["username"];
$password = $_POST["password"];
}

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

$response = array();
$response["success"] = true;  

echo json_encode($response);
?>

The Register request URL used in android studio..

Android Logcat result during the error

  • 写回答

1条回答 默认 最新

    报告相同问题?

    相关推荐 更多相似问题

    悬赏问题

    • ¥60 有关C#的问题,基础牢固的来
    • ¥15 Python算法设计Seam carving--让图片比例随心缩放
    • ¥15 页面制作,HTML CSS
    • ¥15 通个批处理实现 win7和win10 修改或设置:显示操作系统列表时间为2秒
    • ¥20 报错:Unsupported class file major version 59
    • ¥15 用ASP代码实现跨站脚本攻击
    • ¥50 ABP中怎样接收vue上传的图片
    • ¥15 uniapp设置音频的倍速播放无效
    • ¥15 关于#hc#的问题,如何解决?
    • ¥15 cyclegan跨模态生成