Hi,
I'm using InvisionPB to construct a query and basically generate a custom table. The following is what I have. I can get the query to echo prior to the switch/case but can't get it to display within the case itself. Any ideas?
$this->DB->build( array( 'select' => "m.name",
'from' => array('members' => 'm'),
'add_join' => array( array('select' => 'p.position',
'from' => array('wt' => 'p'),
'where' => "m.member_id = p.id",
'type' => 'left',
)
),
'having' => 'p.position = 41',
)
);
$this->DB->execute();
$wt1 = $this->DB->fetch();
// THIS ECHOS FINE HERE SO THE VALUE DOES EXIST BUT DOESN'T PASS TO THE SWITCH/CASE
foreach($wt1 as $wt2) {
echo rtrim($wt2, "41");
}
//
$x=$org;
switch ($x)
{
case hto:
print ("<TABLE BORDER CELLPADDING=3>
<TR ALIGN=CENTER VALIGN=TOP><br /><TH VALIGN=TOP COLSPAN='1'><center> HEAD");
print ("</center><br /></TH></TR>");
// VALUE DOES NOT PRINT BELOW IN TABLE
print ("<td align='center'>$wt2</td>");
break;
I've also had to use rtrim to trim the array output - which presents itself as an example as James41 (as if the 41 is being carried in to the array). The value within the "case" that prints is "41" - I lose the "James" part completely?