我无法弄清楚,由于某种原因,我收到此错误消息:
Database query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND ptb_block_user.blocked=1' at line 5
这是我的mysql查询,不知道是什么问题,请有人帮帮我吗?
function blocked_users() {
global $connection;
global $_SESSION;
global $profile_id;
$query = "SELECT *
FROM ptb_block_user
WHERE ptb_block_user.blocked_id = \"$profile_id\"
AND ptb_block_user.user_id = ".$_SESSION['user_id']."
AND ptb_block_user.blocked='1' ";
$blocked_users = mysql_query($query, $connection);
confirm_query($blocked_users);
return $blocked_users;
}