I have two mysql tables on script. Now I need to display some notifications but problem is that two different tables are used for that and in one it's showed for user if there is pending and in second for admin. So admin must approve it for user to be showed.
This is my code:
$test=$mysql->echo_one("
SELECT COUNT(*)
FROM `cpm_ad_mapping`
WHERE
`status` = '-1'
AND `uid` = '$uid'
");
$thead->setValue("{NON}", $test);
$test2=$mysql->echo_one("
SELECT COUNT(*)
FROM `cpm_ads`
WHERE
`status` = '1'
AND `uid` = '$uid'
");
$thead->setValue("{NON1}", $test2);
How can I match these two status values so I get count if first is ='-1'
and second is ='1'
?