|
I am haveing trouble with using embeded MYSQL if i stuff a numeric value in my $myid array and try to pass it to my equi-join below it is given me back in the result set all the rows but you can see i have added the AND " . TABLE_PREFIX . "groups_members.userid = '" . $myid[0] . "' to my equi- join and the AND does not seem to be filtering the result set by only retuning the records after tables have been joined only the records where the userid = 1 -Please see what i might be doing wrong.
$myid = array();
$myid[0] = 1;
echo "<br>";
echo $myid[0];
$groupname_result = $db->query_read("select " . TABLE_PREFIX . "groups_members.groupid, " . TABLE_PREFIX . "groups_groups.groupname
from " . TABLE_PREFIX . "groups_members, " . TABLE_PREFIX . "groups_groups
where " . TABLE_PREFIX . "groups_members.groupid = " . TABLE_PREFIX . "groups_groups.id AND " . TABLE_PREFIX . "groups_members.userid = '" . $myid[0] . "'
order by " . TABLE_PREFIX . "groups_members.level DESC");
$groups_count = $db->num_rows($groupname_result);
echo "<br>";
echo $groups_count . ' the number of rows of groups ';
echo "<br>";
THANKS
Note: The MYSQL_has been striped out of the functions they are the same functions.
|