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

Here the button was displayed.but that doesn't work.

sashkello
  • 17,306
  • 24
  • 81
  • 109
  • use double within instead of single quotes – cartina Aug 09 '13 at 05:25
  • I got error if I use double within single quotes. – Maniamutha Krish Aug 09 '13 at 06:04
  • The first sentence seems to have error. SET @pid = "$memberID = getLoggedId(); You are not closing double quotes and they are not even necessary here. if condition should not be in double quotes. – cartina Aug 09 '13 at 06:42
  • I add these contents in install.sql file in boonex-Dolphin.I have to SET @pid all above contents not only $memberID = getloggedID();. – Maniamutha Krish Aug 09 '13 at 06:55
  • See my edited answer. Check if it works for you. I have used php [heredoc](http://stackoverflow.com/questions/5673269/is-there-a-reason-to-use-heredoc-in-php) to resolve the issue with the quotes. – cartina Aug 09 '13 at 07:21
  • In boonex - Dolphin,I have to pass these contents by using insert query during install the module. At that time I got this error – Maniamutha Krish Aug 09 '13 at 08:46
  • If we add the Insert query in the install.sql file, the values are automatically inserted during install the module.Here I used the below query – Maniamutha Krish Aug 09 '13 at 08:52
  • INSERT INTO `sys_page_compose` (`ID`, `Page`, `PageWidth`, `Desc`, `Caption`, `Column`, `Order`, `Func`, `Content`, `DesignBox`, `ColWidth`, `Visible`, `MinWidth`, `Cache`) VALUES ('', 'member', '1140px', 'Study With Private Teacher', 'Study With Private Teacher', '1', '1', 'php',@pid, '11', '71.9', 'memb',0,0); – Maniamutha Krish Aug 09 '13 at 08:53
  • Why are you setting if condition in doublequotes? Do not you need to evaluate this? – cartina Aug 09 '13 at 09:23
  • Yes I need evaluate.Because I gave two values for Pid. That's may be 0 or 1. The button should display if the Pid is 1.So I put the if condition here. – Maniamutha Krish Aug 09 '13 at 09:39
  • Then why are you using simple echo within if – cartina Aug 09 '13 at 09:44
  • Then why are you using simple echo within if? it is not affecting pid in any way. pid is just what you get from getLoggedIn(); Pls Check the edited code below – cartina Aug 09 '13 at 09:46
  • I have used the below code now.I got the same error – Maniamutha Krish Aug 09 '13 at 10:30
  • We can't use the double or single quotes within the double quotes in install.sql file. Refer boonex Dolphin – Maniamutha Krish Aug 09 '13 at 10:31

1 Answers1

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>';
}
cartina
  • 1,409
  • 13
  • 21
  • Installation of: InviteTeacher Failed -- Changing database: -- -- There are errors in the following MySQL queries: -- -- Error: SET @pid = <<-- -- Error: – Maniamutha Krish Aug 09 '13 at 08:39