Mysql 查询 - 无法在另一个单引号中添加单引号


Mysql query - couldn't add single quotes within the another single quotes

SET @pid = "$memberID = getLoggedId(); 
$iPid = $GLOBALS['MySQL']->getOne('SELECT `Pid` FROM `Profiles` WHERE `ID` = '.$memberID.' LIMIT 1');
if($iPid==1){
    echo '<div id=# style=margin:10px 10px 0; overflow: hidden;><button class=bx-btn bx-btn-img onclick = window.open(inviteteacher.php,_self) > Study with Private Teacher </button></div>';
}";

此处显示了按钮。但这不起作用。

SET @pid = $memberID = getLoggedId();
$iPid = $GLOBALS['MySQL']->getOne("SELECT `Pid` FROM `Profiles` WHERE `ID` = '$memberID' LIMIT 1");
if($iPid==1){
    echo '<div id="id" style="margin:10px 10px 0;" overflow: "hidden;">
   <button class="bx-btn bx-btn-img" onclick = "window.open(inviteteacher.php,_self)"> Study with Private Teacher </button>
</div>';
}