gpt4 book ai didi

php - 通过php在mysql表中添加引号

转载 作者:行者123 更新时间:2023-11-29 14:16:56 26 4
gpt4 key购买 nike

$sql_images = "'".$uploaded_image."', '".$uploaded_image2."', '".$uploaded_image3."', '".$uploaded_image4."', '".$uploaded_image5."'";

$db->query("UPDATE menu SET nav_name = $navigation, image_bg = $sql_images WHERE id = $id;") or die(mysql_error());

我无法更新我的表,我知道问题出在 $sql_images 变量上,因为我添加了引号并将其弄乱了,但这就是我想要和需要的方式,有什么方法可以添加该变量表中没有任何问题吗?因为现在它给了我一个错误。

最佳答案

试试这样

$sql_images = "\'".$uploaded_image."\', \'".$uploaded_image2."\', \'".$uploaded_image3."\', \'".$uploaded_image4."\', \'".$uploaded_image5."\'";

$db->query("UPDATE menu SET nav_name = '$navigation', image_bg = '$sql_images' WHERE id = $id;") or die(mysql_error());

关于php - 通过php在mysql表中添加引号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12486338/

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