我想插入數組值到數據庫的單一行和列如何插入數組值成單列和單行在PHP
$str_accommodation_level = "SELECT * FROM interest";
$query_accommodation_level = $dbcon->query($str_accommodation_level);
while ($accommodation_level = $query_accommodation_level->fetch_array()) {
$level_from = 'type' . $accommodation_level['id'];
if (isset($_COOKIE[$level_from])) {
$level_data += '<span>' . $_COOKIE[$level_from] . '</span> <br>';
}
print $level_data;
}
感謝您在Stack Overflow上註冊。爲了解決您的問題,請在您的問題中提及哪些數據庫表需要更新,表中的哪一列以及哪些變量。你所包含的這段代碼並沒有給出任何說明,它似乎是從cookie中讀取並打印出來的,與你的問題無關。 – trincot