Greetings.
I am trying to select a list of Siblings from a Database I created by performing the following query:
?>
$query="select ID, 1stName, 2ndName, 3rdName from relations where MomID=$data[2] or DadID=$data[3]";
if (!$result = @($query, $link))
{
print("<FONT COLOR='Red'>Error");
}
else
{
while ($array = mysql_fetch_array($result))
{
echo "<a href=\"fam_query.php?action=$array[0]\">$array[1] $array[2] $array[3]</a><br>";
}
?>
This currently works, but returns the target of the query as a sibling like such:
Daniel Lee Baker
<clip>
Other data about Daniel Lee Baker
</clip>
Siblings:
Daniel Lee Baker
Howard Joshua Baker
I would like to eliminate Daniel Lee Baker from being listed as a sibling to Daniel Lee Baker.
Can this be done as a logic argument after the WHERE statement ? such as "and (!ID=$data[0])" or somehting?
$query="select ID, 1stName, 2ndName, 3rdName from relations where MomID=$data[2] or DadID=$data[3] ( while 'ID' is not = to $data[0] )";
Or if someone can point out an if statement that would work before the echo,
if ($array[0] != $data[0])
{then echo "";}
Else
{
echo "<a href=\"fam_query.php?action=$array[0]\"\>$array[1] $array[2] $array[3]</a\><br>";
}
I have tried a number of things, and have been pouring over the Book I bought to learn PHP from (PHP and Mysql Web Development by SAMS), I just can't seem to find the simple thing thats kicking me in the butt.
Anyone have a few pointers to get me headed back into the right direction?
Any help would be greatly appreciated.
ThunderBlayde