我有一个数据库,其中有一行称为形状,并包含矩形、正方形和圆形的条目。我目前有以下代码来仅获取用户请求的形状。(目前它是矩形和圆形、正方形和圆形或只有圆形)。由于某种原因,它无法正常工作并引发数据库错误。谁能帮我?“MEMBER_FROM”是他们所在的列
$where = "";
if($context['no_sq'] == 1 && $context['no_rec'] == 0) {
$where .= " WHERE MEMBER_FROM != 'Square'";
} else if($context['no_sq'] == 1 && $context['no_rec'] == 0) {
$where .= " WHERE MEMBER_FROM != 'Rectangle'";
} else if($context['no_sq'] == 1 && $context['no_rec'] == 1) {
$where .= " WHERE MEMBER_FROM != 'Square' AND MEMBER_FROM != 'Rectangle'";
}
$request = mysql_query("SELECT ID_SHAPES FROM {$db_prefix}shapes WHERE ID_MEMBER = {$memID}{$where}", __FILE__, __LINE__);