在php中连接带引号的mysql查询

在php中连接带引号的mysql查询,php,mysql,Php,Mysql,在这个查询中,我必须关闭引号,以便为会话提供用户id。但最后我想限制1,但我不能,因为引号已经很接近了 //我在php文件中的查询 "SELECT * from grouptitle where userid=".$_SESSION['userid']; //我想要的查询(引号在iduser之后关闭 "SELECT * from grouptitle where iduser=".$_SESSION['iduser'] LIMIT 1; 试试这个 “从组标题中选择*,其中iduser={$\

在这个查询中,我必须关闭引号,以便为会话提供用户id。但最后我想限制1,但我不能,因为引号已经很接近了

//我在php文件中的查询

"SELECT * from grouptitle where userid=".$_SESSION['userid'];
//我想要的查询(引号在iduser之后关闭

"SELECT * from grouptitle where iduser=".$_SESSION['iduser'] LIMIT 1;
试试这个

“从组标题中选择*,其中iduser={$\u会话['iduser']}限制1”


“从组标题中选择*,其中iduser=“.$\u会话['iduser']”。“限制1”

@jose这是否解决了您的问题?如果是,请将此答案标记为已接受。非常感谢:)