Code
if ($result->EOF) {
$sql2 = "SELECT $groupscolumn[name] FROM $groupstable";
$result2 = $dbconn->Execute($sql2);
$myrow = mysql_fetch_array($result2);
$grpmem = pnVarPrepForStore($info[0]["ou"][0]);
if ($myrow != $grpmem) {
$query3 = "INSERT INTO $groupstable
( $groupscolumn[name])
VALUES('".pnVarPrepForStore($info[0]["ou"][0])."'
)";
$dbconn->Execute($query3);
$gid = $dbconn->PO_Insert_ID($groupstable,$groupscolumn['gid']);
}
else
{
}
$sql2 = "SELECT $groupscolumn[name] FROM $groupstable";
$result2 = $dbconn->Execute($sql2);
$myrow = mysql_fetch_array($result2);
$grpmem = pnVarPrepForStore($info[0]["ou"][0]);
if ($myrow != $grpmem) {
$query3 = "INSERT INTO $groupstable
( $groupscolumn[name])
VALUES('".pnVarPrepForStore($info[0]["ou"][0])."'
)";
$dbconn->Execute($query3);
$gid = $dbconn->PO_Insert_ID($groupstable,$groupscolumn['gid']);
}
else
{
}
It is still duplicating the groups though. I try to echo $myrow and I either get nothing, 'Object', or 'Array'. If I echo $grpmem I get the correct department. I have been looking at this same piece of code for the last 6 hours and my eyes are beginning to bleed. Can anyone shed some light on this for me?
Thanks,
Vance
