首先,我从会话中获取 BedrijfID
$Deals = $_SESSION['login'];
$sSql = "SELECT BedrijfID FROM tblBedrijf WHERE Email = '$Deals'";
$res = $conn->query($sSql);
return $res;
比我需要把它放在另一个表中
$sql = "INSERT INTO tblDeal (Dealnaam, Dealkeuze, Dealbeschrijving,BedrijfID)
VALUES
(
'" . $conn -> real_escape_string($this -> m_sNaamdeal) . "',
'" . $conn -> real_escape_string($this -> m_sAantal) . "',
'" . $conn -> real_escape_string($this -> m_sBeschrijving) . "',
'" . $conn -> real_escape_string($res) . "'
);";
错误:
警告:mysqli::real_escape_string() 期望参数 1 是字符串,对象在 /