hopefully I can explain this clearly enough.
On my profile page (let's call it profile.php), I am including a header file (header.php) that contains all the HTML header code and menu, as well as some queries to show stats to a user (how many surveys they have completed, and rewards earned). There are multiple queries on this page, but all work as expected, such as
header.php
<h3>
<?php
$whereCnt = array(
array('svy_end_status','=',1),
array('svy_end_mem_id','=',$member_id)
);
$svycnt = DB::getInstance()->get( 'COUNT(*) AS Count', 'survey_end', $whereCnt );
echo $svycnt->first()->Count;
?>
</h3>
Back in profile.php I have another query to get all the user profile information:
$wheremem = array(
array( 'member-uid', '=', $member_id ));
$completeprofileqry = DB::getInstance()->get('*','members',$wheremem);
NOTE: This is using a DB class based from Codecourse's Login/Register tutorial but is using PDO as the method.
Now, when I do a
if ($completeprofileqry->count()){
echo '<pre>';
print_r($completeprofileqry->first());
echo '</pre>';
I get as the output:
stdClass Object
(
[Count] => 2
)
This output directly correlates with the first query from the included header file, rather than the new query.
Is this due to the 'instance' still being the same?
I should also note, that on my index.php page, I am doing other queries, as well as using the same included header.php, but I am having NO issues with these query results.
Can anyone help narrow down where the problem might be?
EDIT: I am an idiot
It was meant to be 'member_uid' NOT 'member-uid' (underscore not hyphen !!!)