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

时间:2013-08-09 05:11:36

标签: php mysql boonex-dolphin

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>';
}";

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

1 个答案:

答案 0 :(得分:0)

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>';
}