0
$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 变量上,因为我添加了引号并将其全部搞砸了,但这就是我想要和需要的方式,有没有办法在表中添加该变量没有任何问题?因为现在它给了我一个错误。

4

1 回答 1

1

像这样试试

$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());
于 2012-09-18T23:11:20.680 回答