gpt4 book ai didi

php - 这个查询有什么问题

转载 作者:行者123 更新时间:2023-11-29 08:04:36 26 4
gpt4 key购买 nike

$query = "INSERT INTO patients ( username, idn, email, mobilenumber, healthcenter, height, weight, city, state ) 
VALUES ( :name, :id, :mail, :mn, :hc, :heightv, :weightv, :cityv, :statev ) ";

//Again, we need to update our tokens with the actual data:

$query_params = array(
':name' => $_POST['username'],
':id' => $_POST['idn'],
':mail' => $_POST['email'],
':mn' => $_POST['mobilenumber'],
':hc' => $_POST['healthcenter'],
':hightv' => $_POST['height'],
':weightv' => $_POST['weight'],
':cityv' => $_POST['city'],
':statev' => $_POST['state']
);

//time to run our query, and create the user

try {
$stmt = $db->prepare($query);
$result = $stmt->execute($query_params);
}

最佳答案

在您的 query_params 中,您拼写错误了 heightv

你应该使用

':heightv' => $_POST['height'],

而不是

':hightv' => $_POST['height'],

关于php - 这个查询有什么问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22982251/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com