gpt4 book ai didi

php - 查询的最后一部分不起作用

转载 作者:行者123 更新时间:2023-11-29 18:50:51 24 4
gpt4 key购买 nike

我有一些代码,但是 $query_last 不起作用,之前的 identica 部分 $query - 没有问题。

我不明白问题出在哪里。

<?php
if ($_SERVER["REQUEST_METHOD"]=="POST"){
require 'connect_k.php';
createMessage();
}

function createMessage(){
global $connect;
$email = $_POST["email"];
$price_main = $_POST["price_main"];
$date = $_POST["date"];
$order_number = $_POST["order_number"];
$query="INSERT INTO final(email,name,size,quantity,price)SELECT email,name,size,quantity,price FROM items_cart WHERE email like ('$email');";
$query_del="DELETE FROM items_cart WHERE email like ('$email');";
$query_upd="UPDATE final SET price_main='$price_main',order_number='$order_number',date='$date' WHERE email like ('$email');";
----problem is here----
$query_last="INSERT INTO order(email,name,size,quantity,price,price_main,order_number,date)SELECT email,name,size,quantity,price,price_main,order_number,date FROM final WHERE email like ('$email');";
mysqli_query ($connect,$query)or die (mysqli_error($connect));
mysqli_query ($connect,$query_del)or die (mysqli_error($connect));
mysqli_query ($connect,$query_upd)or die (mysqli_error($connect));
mysqli_query ($connect,$query_last)or die (mysqli_error($connect));
mysqli_close($connect);
}
?>

最佳答案

试试这个我已经修改了我的查询

    $query_last  = "SELECT email,name,size,quantity,price,price_main,order_number,date FROM final WHERE email like ('$email');";
mysqli_query ($connect,$query_last)or die (mysqli_error($connect));
$new_last_qr ="INSERT INTO order(email,name,size,quantity,price,price_main,order_number,date) values (-- Set return values of $query_last --");
mysqli_query ($connect,$new_last_qr)or die (mysqli_error($connect));

谢谢

关于php - 查询的最后一部分不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44363454/

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