Thanks, that works great!
I have a follow up question, but I don't know if I should post it here or start a new thread in the MySQL section. This actually seems like more of a PHP problem to me. Anyway, the moderators can move this thread to the MySQL section if they want.
I'm not sure if Implemented your script perfectly. I simply found a similar script on my site and tweaked it to make it work like your script. This is what I wound up with:
Code:
$sql = "SELECT COUNT(*) AS numberofurls
FROM gz_life
WHERE Parent = '$MyURL'";
$sql_result = mysql_query($sql,$conn);
$result = mysql_fetch_assoc($sql_result);
$sql_result = mysql_query($sql,$conn);
$result = mysql_fetch_assoc($sql_result);
switch ($result['numberofurls'])
{
case 1:
echo 'No Siblings';
break;
case 0:
echo 'NADA';
break;
default:
echo 'Siblings';
break;
}
Now I'd like to figure out how to make this skip a level. For example, imagine the following values:
(order) Artiodactyla
(family) Antilocapridae
Bovidae is Artiodactyla's child, and it has several siblings, so the script above would display "Siblings"
Now imagine the following relationship:
(family) Antilocapridae
(genus) Antilocapra
(species) (Antilocapra_americana)
This time, I want to know how many species are in a family, which means I want to IGNORE genus. In fact, Antilocapra_americana has no siblings; it's the only species in family Antilocapridae.
So does anyone know if there's a way to write a script that will essentially display the number of siblings for GRANDCHILDREN?
Thanks.
Bookmarks