Hi, I have a family database, and I am having trouble displaying a family member that has more than one child.
$bw=$_GET["id"];
mysql_pconnect("localhost","user","password");
mysql_select_db("database");
$result = mysql_query("SELECT * FROM Members WHERE id='$id'");
$row = mysql_fetch_array ($result, MYSQL_ASSOC);
echo "Member: ";
$result2 = mysql_query("SELECT * FROM spouse WHERE mid='$id'");
$row2 = mysql_fetch_array ($result2, MYSQL_ASSOC);
$result3 = mysql_query("SELECT * FROM child WHERE mid='$id'");
$row3 = mysql_fetch_array ($result3, MYSQL_ASSOC);
echo $row;
echo " ";
echo $row;
echo "<p></p>Family Information:";
if(mysql_num_rows($result2)==1){
echo " Spouse: ";
echo $row2;
echo " ";
echo $row2;
}
if(mysql_num_rows($result3)==0){}
elseif(mysql_num_rows($result3)==1){
echo " Child: ";
echo $row3;
echo " ";
echo $row3;
} else {
echo $row3;
echo " ";
echo $row3; }