kendallkamikaze Posted December 1, 2008 Share Posted December 1, 2008 Hey guys! I am having a little trouble with a breeding script I am using. I own an horse SIM game and obviously,this script is used to breed horses. Here is the script, I'll post my problem below it <?php include 'header.php'; ?> <?php $mare=$_POST['mareid']; $sql="SELECT * FROM horsedata WHERE id='$mare'"; $result=mysql_query($sql); while($r=mysql_fetch_array($result)) { $Height=$r["Height"]; $Owner=$r["Owner"]; $Marebreed=$r["Breed"]; $Marecolor=$r["Color"]; $MareSpeed=$r["Speed"]; $MareScope=$r["Scope"]; $MareEndurance=$r["Endurance"]; $MarePower=$r["Power"]; $MareObedience=$r["Obedience"]; $MareSociability=$r["Sociability"]; $MareIntelligence=$r["Intelligence"]; $MareTemperment=$r["temperament"]; $MareLegs=$r["legs"]; $MareBack=$r["back"]; $MareNeck=$r["neck"]; $MareHead=$r["head"]; } ?> <?php $stall=$_POST['stallid']; $sql="SELECT * FROM horsedata WHERE id='$stall'"; $result=mysql_query($sql); while($r=mysql_fetch_array($result)) { $Stallbreed=$r["Breed"]; $Stallcolor=$r["Color"]; $StallSpeed=$r["Speed"]; $StallScope=$r["Scope"]; $StallEndurance=$r["Endurance"]; $StallPower=$r["Power"]; $StallObedience=$r["Obedience"]; $StallSociability=$r["Sociability"]; $StallIntelligence=$r["Intelligence"]; $StallTemperment=$r["temperament"]; $StallLegs=$r["legs"]; $StallBack=$r["back"]; $StallNeck=$r["neck"]; $StallHead=$r["head"]; } ?> <?php if($Marebreed == $Stallbreed) { $Foalbreed=$Marebreed; } else { $Foalbreed="$Marebreed x $Stallbreed"; } echo "$Foalbreed"; ?> <br><br> <?php $sql="SELECT * FROM colour WHERE coloura='$Stallcolor' OR coloura='$Marecolor' and colourb='$Marecolor' OR colourb='$Stallcolor' ORDER BY RAND() limit 0,1 "; $result=mysql_query($sql); while($r=mysql_fetch_array($result)) { $Foalcolor=$r["result"]; echo "$Foalcolor"; } ?> <?php $sql="SELECT * FROM gender ORDER BY RAND() limit 0,1 "; $result=mysql_query($sql); while($r=mysql_fetch_array($result)) { $FoalGender=$r["gender"]; echo "$FoalGender"; } ?> <?php $number1 = $MareSpeed + $StallSpeed; $FoalSpeed = $number1 / 8; echo "$FoalSpeed"; ?> <?php $number1 = $MareScope + $StallScope; $FoalScope= $number1 / 8; echo "$FoalScope"; ?> <?php $number1 = $MareEndurance + $StallEndurance; $FoalEndurance = $number1 / 8; echo "$FoalEndurance"; ?> <?php $number1 = $MarePower + $StallPower; $FoalPower = $number1 / 8; echo "$FoalPower"; ?> <?php $number1 = $MareObedience + $StallObedience; $FoalObedience = $number1 / 8; echo "$FoalObedience"; ?> <?php $number1 = $MareSociability + $StallSociability; $FoalSociability = $number1 / 8; echo "$FoalSociability"; ?> <?php $number1 = $MareIntelligence + $StallIntelligence; $FoalIntelligence= $number1 / 8; echo "$FoalIntelligence"; ?> <?php $number1 = $MareTemperament + $StallTemperament; $FoalTemperament= $number1 / 2; echo $FoalTemperament; ?> <?php $number1 = $MareLegs + $StallLegs; $FoalLegs= $number1 / 2; echo $FoalLegs; ?> <?php $number1 = $MareBack + $StallBack; $FoalBack= $number1 / 2; echo "$FoalBack"; ?> <?php $number1 = $MareHead + $StallHead; $FoalHead= $number1 / 2; echo "$FoalHead"; ?> <?php $number1 = $MareNeck + $StallNeck; $FoalNeck= $number1 / 2; echo "$FoalNeck"; ?> <br><br> <?php $number = $MareScope + $StallScope; $Pedigree = $number / 60; if ($Pedigree > 100) { $Pedigree = "100"; } if ($Pedigree < 15) { $Pedigree ="15"; } echo "$Pedigree"; ?> <?php $sql="INSERT INTO horsedata (Name, Owner, Height, Breed, Gender, Registrations, Exp, Points, Records, Speed, Scope, Power, Obedience, Sociability, Sire, Dam, Foals, Awards, Grading, Image, Hay, Grain, Vet, Shoes, Exercise, Grooming, DOB, Endurance, Intelligence, Color, temperament, legs, back, neck, head, pedigree) VALUES ('New Foal','$Owner','$Height','$Foalbreed','$FoalGender','Not Registered','0','0','none','$FoalSpeed','$FoalScope','$FoalPower','$FoalObedience','$FoalSociability','$stall','$mare','None yet','This horse has not won any awards','Not Graded','default.jpg','No','No','No','No','No','No','0','$FoalEndurance','$FoalIntelligence','$Foalcolor','$FoalTemperament','$FoalLegs','$FoalBack','$FoalNeck','$FoalHead', '$Pedigree')"; if (!mysql_query($sql)) { die('Error: ' . mysql_error()); } echo "Foal Created Successfully with above stats"; ?> Yes, rather a long code it is xD anyway the problem I have is on the horses pages it has a box that says "Foals:" In this box, I want the foals ID in which the horses have had. for example if horse #6 and #7 is the father and mother to horse # 8 I want #8 to put into #6 and #7's foal box. with me so far? Anyway..I don't know how I am supposed to do that. I need to grab the foals ID, keeping in mind this breeding script makes the foal. so..what I need you guys to help me with it grabbing the foals ID and placing the foals ID into the mother and fathers "foal:" box. If you can help please do so. All help would be handy. If you need me to explain any if this in a bit clearer Eng,lish, please ask me to do so xD thanks Quote Link to comment https://forums.phpfreaks.com/topic/135021-breeding-script-help/ Share on other sites More sharing options...
flyhoney Posted December 1, 2008 Share Posted December 1, 2008 mysql_insert_id should help. Use it right after you INSERT the new horse to get that horse's ID. Quote Link to comment https://forums.phpfreaks.com/topic/135021-breeding-script-help/#findComment-703232 Share on other sites More sharing options...
kendallkamikaze Posted December 1, 2008 Author Share Posted December 1, 2008 mysql_insert_id should help. Use it right after you INSERT the new horse to get that horse's ID. Hey, thanks for that. Could you explain that a little better, please? Do you mean we place the mysql_insert_id right after the mysql query which inserts the new foal into the database and that should grab the foals ID? Quote Link to comment https://forums.phpfreaks.com/topic/135021-breeding-script-help/#findComment-703237 Share on other sites More sharing options...
flyhoney Posted December 1, 2008 Share Posted December 1, 2008 Yep, like so: <?php $sql="INSERT INTO horsedata (Name, Owner, Height, Breed, Gender, Registrations, Exp, Points, Records, Speed, Scope, Power, Obedience, Sociability, Sire, Dam, Foals, Awards, Grading, Image, Hay, Grain, Vet, Shoes, Exercise, Grooming, DOB, Endurance, Intelligence, Color, temperament, legs, back, neck, head, pedigree) VALUES ('New Foal','$Owner','$Height','$Foalbreed','$FoalGender','Not Registered','0','0','none','$FoalSpeed','$FoalScope','$FoalPower','$FoalObedience','$FoalSociability','$stall','$mare','None yet','This horse has not won any awards','Not Graded','default.jpg','No','No','No','No','No','No','0','$FoalEndurance','$FoalIntelligence','$Foalcolor','$FoalTemperament','$FoalLegs','$FoalBack','$FoalNeck','$FoalHead', '$Pedigree')"; if (!mysql_query($sql)) { die('Error: ' . mysql_error()); } $foal_id = mysql_insert_id(); echo "Foal Created Successfully with above stats and ID: #" . $foal_id; ?> Quote Link to comment https://forums.phpfreaks.com/topic/135021-breeding-script-help/#findComment-703246 Share on other sites More sharing options...
kendallkamikaze Posted December 1, 2008 Author Share Posted December 1, 2008 Yep, like so: <?php $sql="INSERT INTO horsedata (Name, Owner, Height, Breed, Gender, Registrations, Exp, Points, Records, Speed, Scope, Power, Obedience, Sociability, Sire, Dam, Foals, Awards, Grading, Image, Hay, Grain, Vet, Shoes, Exercise, Grooming, DOB, Endurance, Intelligence, Color, temperament, legs, back, neck, head, pedigree) VALUES ('New Foal','$Owner','$Height','$Foalbreed','$FoalGender','Not Registered','0','0','none','$FoalSpeed','$FoalScope','$FoalPower','$FoalObedience','$FoalSociability','$stall','$mare','None yet','This horse has not won any awards','Not Graded','default.jpg','No','No','No','No','No','No','0','$FoalEndurance','$FoalIntelligence','$Foalcolor','$FoalTemperament','$FoalLegs','$FoalBack','$FoalNeck','$FoalHead', '$Pedigree')"; if (!mysql_query($sql)) { die('Error: ' . mysql_error()); } $foal_id = mysql_insert_id(); echo "Foal Created Successfully with above stats and ID: #" . $foal_id; ?> Thankyou Quote Link to comment https://forums.phpfreaks.com/topic/135021-breeding-script-help/#findComment-703247 Share on other sites More sharing options...
kendallkamikaze Posted December 1, 2008 Author Share Posted December 1, 2008 how would we go about having it instert it onto the parents page?? and do you know how to link it up to mysql so that the foal is born on the date thats listed in mysql? Quote Link to comment https://forums.phpfreaks.com/topic/135021-breeding-script-help/#findComment-703282 Share on other sites More sharing options...
kendallkamikaze Posted December 1, 2008 Author Share Posted December 1, 2008 anyone have any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/135021-breeding-script-help/#findComment-703319 Share on other sites More sharing options...
Maq Posted December 1, 2008 Share Posted December 1, 2008 You need to make more tables. It's called normalization. You have everything in 1 table which gets very messy very fast. You need to create primary/foreign keys. Why don't you create a table called foal_parents and relate each foal to a their parents? Quote Link to comment https://forums.phpfreaks.com/topic/135021-breeding-script-help/#findComment-703332 Share on other sites More sharing options...
kendallkamikaze Posted December 2, 2008 Author Share Posted December 2, 2008 <?php //include 'header.php'; include 'databaseconnection.php'; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); //Some variables $minRandPedigree = 12; $maxRandPedigree = 95; $foal=$_POST['foalid']; $sql="SELECT * FROM horsedata WHERE id='$foal'"; $result=mysql_query($sql); $mID = mysql_query("SELECT * FROM `breedwait` WHERE `dateoc` < NOW() AND (mareid != 'clone' AND stallionid != 'clone')"); if(mysql_num_rows($mID) > 0){ while($mROW = mysql_fetch_array($mID)){ $mare=$mROW['mareid']; $mROWID = $mROW['id']; $sql="SELECT * FROM horsedata WHERE id='$mare'"; $result=mysql_query($sql); // Horse Info while($r=mysql_fetch_array($result)){ $Height=$r["Height"]; $Owner=$r["Owner"]; $Marebreed=$r["Breed"]; $Marecolor=$r["Color"]; $MareSpeed=$r["Speed"]; $MareScope=$r["Scope"]; $MareEndurance=$r["Endurance"]; $MarePower=$r["Power"]; $MareObedience=$r["Obedience"]; $MareSociability=$r["Sociability"]; $MareIntelligence=$r["Intelligence"]; $MareTemperment=$r["temperament"]; $MareLegs=$r["legs"]; $MareBack=$r["back"]; $MareNeck=$r["neck"]; $MareHead=$r["head"]; $MarePedigree=$r["pedigree"]; $MareFoals=$r["Foals"]; } $stall=$mROW['stallid']; $sql="SELECT * FROM horsedata WHERE id='$stall'"; $result=mysql_query($sql); // Stall Info while($r=mysql_fetch_array($result)){ $id=$r["id"]; $Stallbreed=$r["Breed"]; $Stallcolor=$r["Color"]; $StallSpeed=$r["Speed"]; $StallScope=$r["Scope"]; $StallEndurance=$r["Endurance"]; $StallPower=$r["Power"]; $StallObedience=$r["Obedience"]; $StallSociability=$r["Sociability"]; $StallIntelligence=$r["Intelligence"]; $StallTemperment=$r["temperament"]; $StallLegs=$r["legs"]; $StallBack=$r["back"]; $StallNeck=$r["neck"]; $StallHead=$r["head"]; $StallPedigree=$r["pedigree"]; $StallFoals=$r["Foals"]; } // Last 10 horses $result = mysql_query("SELECT id FROM horsedata order by id DESC LIMIT 10")or die ('cannot select horse info'); $row = mysql_fetch_array($result); $id = $row['id']; $foalid = $id + 1; $newid = $foalid; if($Marebreed == $Stallbreed) { $Foalbreed=$Marebreed; } elseif(($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa') && ($Marebreed == 'Arabian' || $Stallbreed == 'Arabian')){ $Foalbreed='Araloosa'; }elseif(($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse') && ($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred')){ $Foalbreed='Appendix Quarter Horse'; } elseif(($Marebreed == 'Andalusian' || $Stallbreed == 'Andalusian') && ($Marebreed == 'Arabian' || $Stallbreed == 'Arabian')){ $Foalbreed='Alter-Real';} elseif(($Marebreed == 'Andalusian' || $Stallbreed == 'Andalusian') && ($Marebreed == 'Spanish Arabian' || $Stallbreed == 'Spanish Arabian')){ $Foalbreed='Alter-Real'; } elseif(($Marebreed == 'Lusitano' || $Stallbreed == 'Lusitano') && ($Marebreed == 'Arabian' || $Stallbreed == 'Arabian')){ $Foalbreed='Alter-Real'; } elseif(($Marebreed == 'Andalusian' || $Stallbreed == 'Lusitano') && ($Marebreed == ' Spanish Arabian' || $Stallbreed == ' Spanish Arabian')){ $Foalbreed='Alter-Real'; } elseif(($Marebreed == 'Alter-Real' || $Stallbreed == 'Alter-Real') && ($Marebreed == 'Arabian' || $Stallbreed == 'Arabian')){ $Foalbreed='Alter-Real'; } elseif(($Marebreed == 'Alter-Real' || $Stallbreed == 'Alter-Real') && ($Marebreed == 'Spanish Arabian' || $Stallbreed == 'Spanish Arabian')){ $Foalbreed='Alter-Real'; } elseif(($Marebreed == 'Alter-Real' || $Stallbreed == 'Alter-Real') && ($Marebreed == 'Spanish Arabian' || $Stallbreed == 'Spanish Arabian')){ $Foalbreed='Alter-Real'; } elseif(($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred') && ($Marebreed == 'American Cream Draft' || $Stallbreed == 'American Cream Draft')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred') && ($Marebreed == 'Ardennais' || $Stallbreed == 'Ardennais')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred') && ($Marebreed == 'Clydesdale' || $Stallbreed == 'Clydesdale')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred') && ($Marebreed == 'Belgian' || $Stallbreed == 'Belgian')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred') && ($Marebreed == 'Percheron' || $Stallbreed == 'Percheron')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred') && ($Marebreed == 'Russian Heavy Draft' || $Stallbreed == 'Russian Heavy Draft')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred') && ($Marebreed == 'Shire' || Stallbreed == 'Shire')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred') && ($Marebreed == 'Spanish Norman' || $Stallbreed == 'Spanish Norman')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred') && ($Marebreed == 'Suffolk Punch' || $Stallbreed == 'Suffolk Punch')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred') && ($Marebreed == 'Vladimir Heavy Draft' || $Stallbreed == 'Vladimir Heavy Draft')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred') && ($Marebreed == 'Shire' || $Stallbreed == 'Shire')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'American Warmblood' || $Stallbreed == 'American Warmblood') && ($Marebreed == 'American Cream Draft' || $Stallbreed == 'American Cream Draft')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'American Warmblood' || $Stallbreed == 'American Warmblood') && ($Marebreed == 'Ardennais' || $Stallbreed == 'Ardennais')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'American Warmblood' || $Stallbreed == 'American Warmblood') && ($Marebreed == 'Clydesdale' || $Stallbreed == 'Clydesdale')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'American Warmblood' || $Stallbreed == 'American Warmblood') && ($Marebreed == 'Belgian' || $Stallbreed == 'Belgian')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'American Warmblood' || $Stallbreed == 'American Warmblood') && ($Marebreed == 'Percheron' || $Stallbreed == 'Percheron')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'American Warmblood' || $Stallbreed == 'American Warmblood') && ($Marebreed == 'Russian Heavy Draft' || $Stallbreed == 'Russian Heavy Draft')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'American Warmblood' || $Stallbreed == 'American Warmblood') && ($Marebreed == 'Shire' || $Stallbreed == 'Shire')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'American Warmblood' || $Stallbreed == 'American Warmblood') && ($Marebreed == 'Spanish Norman' || $Stallbreed == 'Spanish Norman')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'American Warmblood' || $Stallbreed == 'American Warmblood') && ($Marebreed == 'Suffolk Punch' || $Stallbreed == 'Suffolk Punch')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'American Warmblood' || $Stallbreed == 'American Warmblood') && ($Marebreed == 'Vladimir Heavy Draft' || $Stallbreed == 'Vladimir Heavy Draft')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'American Warmblood' || $Stallbreed == 'American Warmblood') && ($Marebreed == 'Shire' || $Stallbreed == 'Shire')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'American Warmblood' || $Stallbreed == 'American Warmblood') && ($Marebreed == 'Spanish Norman' || $Stallbreed == 'Spanish Norman')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'American Warmblood' || $Stallbreed == 'American Warmblood') && ($Marebreed == 'Suffolk Punch' || $Stallbreed == 'Suffolk Punch')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'American Warmblood' || $Stallbreed == 'American Warmblood') && ($Marebreed == 'Vladimir Heavy Draft' || $Stallbreed == 'Vladimir Heavy Draft')){ $Foalbreed='American Warmblood'; } elseif(($Marebreed == 'Arabian' || $Stallbreed == 'Arabian') && ($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred')){ $Foalbreed='Anglo-Arabian'; } elseif(($Marebreed == 'Russian Arabian' || $Stallbreed == 'Russian Arabian') && ($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred')){ $Foalbreed='Anglo-Arabian'; } elseif(($Marebreed == 'Spanish Arabian' || $Stallbreed == 'Spanish Arabian') && ($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred')){ $Foalbreed='Anglo-Arabian'; } elseif(($Marebreed == 'Shagya Arabian' || $Stallbreed == 'Shagya Arabian') && ($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred')){ $Foalbreed='Anglo-Arabian'; } elseif(($Marebreed == 'Straight Egyptian Arabian' || $Stallbreed == 'Straight Egyptian Arabian') && ($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred')){ $Foalbreed='Anglo-Arabian'; } elseif(($Marebreed == 'Pintabian' || $Stallbreed == 'Pintabian') && ($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred')){ $Foalbreed='Anglo-Arabian'; } elseif(($Marebreed == 'Anglo-Arabian' || $Stallbreed == 'Anglo-Arabian') && ($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred')){ $Foalbreed='Anglo-Arabian'; } elseif(($Marebreed == 'Anglo-Arabian' || $Stallbreed == 'Anglo-Arabian') && ($Marebreed == 'Arabian' || $Stallbreed == 'Arabian')){ $Foalbreed='Anglo-Arabian'; } elseif(($Marebreed == 'Anglo-Arabian' || $Stallbreed == 'Anglo-Arabian') && ($Marebreed == 'Russian Arabian' || $Stallbreed == 'Russian Arabian')){ $Foalbreed='Anglo-Arabian'; } elseif(($Marebreed == 'Anglo-Arabian' || $Stallbreed == 'Anglo-Arabian') && ($Marebreed == 'Spanish Arabian' || $Stallbreed == 'Spanish Arabian')){ $Foalbreed='Anglo-Arabian'; } elseif(($Marebreed == 'Anglo-Arabian' || $Stallbreed == 'Anglo-Arabian') && ($Marebreed == 'Shagya Arabian' || $Stallbreed == 'Shagya Arabian')){ $Foalbreed='Anglo-Arabian'; } elseif(($Marebreed == 'Anglo-Arabian' || $Stallbreed == 'Anglo-Arabian') && ($Marebreed == 'Straight Egyptian Arabian' || $Stallbreed == 'Straight Egyptian Arabian')){ $Foalbreed='Anglo-Arabian'; } elseif(($Marebreed == 'Anglo-Arabian' || $Stallbreed == 'Anglo-Arabian') && ($Marebreed == 'Pintabian' || $Stallbreed == 'Pintabian')){ $Foalbreed='Anglo-Arabian'; } elseif(($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred') && ($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa')){ $Foalbreed='Appaloosa'; } elseif(($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse') && ($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa')){ $Foalbreed='Appaloosa'; } elseif(($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred') && ($Marebreed == 'Appendix Quarter Horse' || $Stallbreed == 'Appendix Quarter Horse')){ $Foalbreed='Appendix Quarter Horse'; } elseif(($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse') && ($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa')){ $Foalbreed='Appaloosa'; } elseif(($Marebreed == 'Arabian' || $Stallbreed == 'Arabian') && ($Marebreed == 'Russian Arabian' || $Stallbreed == 'Russian Arabian')){ $Foalbreed='Arabian'; } elseif(($Marebreed == 'Arabian' || $Stallbreed == 'Arabian') && ($Marebreed == 'Spanish Arabian' || $Stallbreed == 'Spanish Arabian')){ $Foalbreed='Arabian'; } elseif(($Marebreed == 'Arabian' || $Stallbreed == 'Arabian') && ($Marebreed == 'Shagya Arabian' || $Stallbreed == 'Shagya Arabian')){ $Foalbreed='Arabian'; } elseif(($Marebreed == 'Arabian' || $Stallbreed == 'Arabian') && ($Marebreed == 'Straight Egyptian Arabian' || $Stallbreed == 'Straight Egyptian Arabian')){ $Foalbreed='Arabian'; } elseif(($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa') && ($Marebreed == 'Russian Arabian' || $Stallbreed == 'Russian Arabian')){ $Foalbreed='Araloosa'; } elseif(($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa') && ($Marebreed == 'Spanish Arabian' || $Stallbreed == 'Spanish Arabian')){ $Foalbreed='Araloosa'; } elseif(($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa') && ($Marebreed == 'Shagya Arabian' || $Stallbreed == 'Shagya Arabian')){ $Foalbreed='Araloosa'; } elseif(($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa') && ($Marebreed == 'Straight Egyptian Arabian' || $Stallbreed == 'Straight Egyptian Arabian')){ $Foalbreed='Araloosa'; } elseif(($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa') && ($Marebreed == 'Araloosa' || $Stallbreed == 'Araloosa')){ $Foalbreed='Araloosa'; } elseif(($Marebreed == 'Araloosa' || $Stallbreed == 'Araloosa') && ($Marebreed == 'Arabian' || $Stallbreed == 'Arabian')){ $Foalbreed='Araloosa'; } elseif(($Marebreed == 'Araloosa' || $Stallbreed == 'Araloosa') && ($Marebreed == 'Russian Arabian' || $Stallbreed == 'Russian Arabian')){ $Foalbreed='Araloosa'; } elseif(($Marebreed == 'Araloosa' || $Stallbreed == 'Araloosa') && ($Marebreed == 'Spanish Arabian' || $Stallbreed == 'Spanish Arabian')){ $Foalbreed='Araloosa'; } elseif(($Marebreed == 'Araloosa' || $Stallbreed == 'Araloosa') && ($Marebreed == 'Straight Egyptian Arabian' || $Stallbreed == 'Straight Egyptian Arabian')){ $Foalbreed='Araloosa'; } elseif(($Marebreed == 'Araloosa' || $Stallbreed == 'Araloosa') && ($Marebreed == 'Shagya Arabian' || $Stallbreed == 'Shagya Arabian')){ $Foalbreed='Araloosa'; } elseif(($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse') && ($Marebreed == 'Andalusian' || $Stallbreed == 'Andalusian')){ $Foalbreed='Azteca'; } elseif(($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse') && ($Marebreed == 'Azteca' || $Stallbreed == 'Azteca')){ $Foalbreed='Azteca'; } elseif(($Marebreed == 'Azteca' || $Stallbreed == 'Azteca') && ($Marebreed == 'Andalusian' || $Stallbreed == 'Andalusian')){ $Foalbreed='Azteca'; } elseif(($Marebreed == 'Saddlebred' || $Stallbreed == 'Saddlebred') && ($Marebreed == 'Clydesdale' || $Stallbreed == 'Clydesdale')){ $Foalbreed='Georgian Grande'; } elseif(($Marebreed == 'Saddlebred' || $Stallbreed == 'Saddlebred') && ($Marebreed == 'Friesian' || $Stallbreed == 'Friesian')){ $Foalbreed='Georgian Grande'; } elseif(($Marebreed == 'Saddlebred' || $Stallbreed == 'Saddlebred') && ($Marebreed == 'Percheron' || $Stallbreed == 'Percheron')){ $Foalbreed='Georgian Grande'; } elseif(($Marebreed == 'Saddlebred' || $Stallbreed == 'Saddlebred') && ($Marebreed == 'Shire' || $Stallbreed == 'Shire')){ $Foalbreed='Georgian Grande'; } elseif(($Marebreed == 'Georgian Grande' || $Stallbreed == 'Georgian Grande') && ($Marebreed == 'Friesian' || $Stallbreed == 'Friesian')){ $Foalbreed='Georgian Grande'; } elseif(($Marebreed == 'Georgian Grande' || $Stallbreed == 'Georgian Grande') && ($Marebreed == 'Saddlebred' || $Stallbreed == 'Saddlebred')){ $Foalbreed='Georgian Grande'; } elseif(($Marebreed == 'Georgian Grande' || $Stallbreed == 'Georgian Grande') && ($Marebreed == 'Clydesdale' || $Stallbreed == 'Clydesdale')){ $Foalbreed='Georgian Grande'; } elseif(($Marebreed == 'Georgian Grande' || $Stallbreed == 'Georgian Grande') && ($Marebreed == 'Percheron' || $Stallbreed == 'Percheron')){ $Foalbreed='Georgian Grande'; } elseif(($Marebreed == 'Georgian Grande' || $Stallbreed == 'Georgian Grande') && ($Marebreed == 'Shire' || $Stallbreed == 'Shire')){ $Foalbreed='Georgian Grande'; } elseif(($Marebreed == 'Irish Draught' || $Stallbreed == 'Irish Draught') && ($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred')){ $Foalbreed='Irish Sport Horse'; } elseif(($Marebreed == 'Irish Sport Horse' || $Stallbreed == 'Irish Sport Horse') && ($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred')){ $Foalbreed='Irish Sport Horse'; } elseif(($Marebreed == 'Irish Draught' || $Stallbreed == 'Irish Draught') && ($Marebreed == 'Irish Sport Horse' || $Stallbreed == 'Irish Sport Horse')){ $Foalbreed='Irish Sport Horse'; } elseif(($Marebreed == 'Irish Draught' || $Stallbreed == 'Irish Draught') && ($Marebreed == 'Connemara' || $Stallbreed == 'Connemara')){ $Foalbreed='Irish Sport Pony'; } elseif(($Marebreed == 'Irish Sport Pony' || $Stallbreed == 'Irish Sport Pony') && ($Marebreed == 'Connemara' || $Stallbreed == 'Connemara')){ $Foalbreed='Irish Sport Pony'; } elseif(($Marebreed == 'Irish Sport Pony' || $Stallbreed == 'Irish Sport Pony') && ($Marebreed == 'Irish Sport Pony' || $Stallbreed == 'Irish Sport Pony')){ $Foalbreed='Irish Sport Horse'; } elseif(($Marebreed == 'Morgan' || $Stallbreed == 'Morgan') && ($Marebreed == 'Arabian' || $Stallbreed == 'Arabian')){ $Foalbreed='Morab'; } elseif(($Marebreed == 'Morgan' || $Stallbreed == 'Morgan') && ($Marebreed == 'Russian Arabian' || $Stallbreed == 'Russian Arabian')){ $Foalbreed='Morab'; } elseif(($Marebreed == 'Morgan' || $Stallbreed == 'Morgan') && ($Marebreed == 'Spanish Arabian' || $Stallbreed == 'Spanish Arabian')){ $Foalbreed='Morab'; } elseif(($Marebreed == 'Morgan' || $Stallbreed == 'Morgan') && ($Marebreed == 'Shagya Arabian' || $Stallbreed == 'Shagya Arabian')){ $Foalbreed='Morab'; } elseif(($Marebreed == 'Morgan' || $Stallbreed == 'Morgan') && ($Marebreed == 'Straight Egyptian Arabian' || $Stallbreed == 'Straight Egyptian Arabian')){ $Foalbreed='Morab'; } elseif(($Marebreed == 'Morgan' || $Stallbreed == 'Morgan') && ($Marebreed == 'Morab' || $Stallbreed == 'Morab')){ $Foalbreed='Morab'; } elseif(($Marebreed == 'Morab' || $Stallbreed == 'Morab') && ($Marebreed == 'Arabian' || $Stallbreed == 'Arabian')){ $Foalbreed='Morab'; } elseif(($Marebreed == 'Morab' || $Stallbreed == 'Morab') && ($Marebreed == 'Russian Arabian' || $Stallbreed == 'Russian Arabian')){ $Foalbreed='Morab'; } elseif(($Marebreed == 'Morab' || $Stallbreed == 'Morab') && ($Marebreed == 'Spanish Arabian' || $Stallbreed == 'Spanish Arabian')){ $Foalbreed='Morab'; } elseif(($Marebreed == 'Morab' || $Stallbreed == 'Morab') && ($Marebreed == 'Shagya Arabian' || $Stallbreed == 'Shagya Arabian')){ $Foalbreed='Morab'; } elseif(($Marebreed == 'Morab' || $Stallbreed == 'Morab') && ($Marebreed == 'Straight Egyptian Arabian' || $Stallbreed == 'Straight Egyptian Arabian')){ $Foalbreed='Morab'; } elseif(($Marebreed == 'Kiger Mustang' || $Stallbreed == 'Kiger Mustang') && ($Marebreed == 'Mustang' || $Stallbreed == 'Mustang')){ $Foalbreed='Mustang'; } elseif(($Marebreed == 'Saddlebred' || $Stallbreed == 'Saddlebred') && ($Marebreed == 'Arabian' || $Stallbreed == 'Arabian')){ $Foalbreed='National Show Horse'; } elseif(($Marebreed == 'Saddlebred' || $Stallbreed == 'Saddlebred') && ($Marebreed == 'Russian Arabian' || $Stallbreed == 'Russian Arabian')){ $Foalbreed='National Show Horse'; } elseif(($Marebreed == 'Saddlebred' || $Stallbreed == 'Saddlebred') && ($Marebreed == 'Spanish Arabian' || $Stallbreed == 'Spanish Arabian')){ $Foalbreed='National Show Horse'; } elseif(($Marebreed == 'Saddlebred' || $Stallbreed == 'Saddlebred') && ($Marebreed == 'Shagya Arabian' || $Stallbreed == 'Shagya Arabian')){ $Foalbreed='National Show Horse'; } elseif(($Marebreed == 'Saddlebred' || $Stallbreed == 'Saddlebred') && ($Marebreed == 'Straight Egyptian Arabian' || $Stallbreed == 'Straight Egyptian Arabian')){ $Foalbreed='National Show Horse'; } elseif(($Marebreed == 'National Show Horse' || $Stallbreed == 'National Show Horse') && ($Marebreed == 'Arabian' || $Stallbreed == 'Arabian')){ $Foalbreed='National Show Horse'; } elseif(($Marebreed == 'National Show Horse' || $Stallbreed == 'National Show Horse') && ($Marebreed == 'Saddlebred' || $Stallbreed == 'Saddlebred')){ $Foalbreed='National Show Horse'; } elseif(($Marebreed == 'National Show Horse' || $Stallbreed == 'National Show Horse') && ($Marebreed == 'Russian Arabian' || $Stallbreed == 'Russian Arabian')){ $Foalbreed='National Show Horse'; } elseif(($Marebreed == 'National Show Horse' || $Stallbreed == 'National Show Horse') && ($Marebreed == 'Spanish Arabian' || $Stallbreed == 'Spanish Arabian')){ $Foalbreed='National Show Horse'; } elseif(($Marebreed == 'National Show Horse' || $Stallbreed == 'National Show Horse') && ($Marebreed == 'Shagya Arabian' || $Stallbreed == 'Shagya Arabian')){ $Foalbreed='National Show Horse'; } elseif(($Marebreed == 'National Show Horse' || $Stallbreed == 'National Show Horse') && ($Marebreed == 'Straight Egyptian Arabian' || $Stallbreed == 'Straight Egyptian Arabian')){ $Foalbreed='National Show Horse'; } elseif(($Marebreed == 'Paint' || $Stallbreed == 'Paint') && ($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse')){ $Foalbreed='Paint'; } elseif(($Marebreed == 'Paint' || $Stallbreed == 'Paint') && ($Marebreed == 'Quarter Pony' || $Stallbreed == 'Quarter Pony')){ $Foalbreed='Paint'; } elseif(($Marebreed == 'Paint' || $Stallbreed == 'Paint') && ($Marebreed == 'Arabian' || $Stallbreed == 'Arabian')){ $Foalbreed='Pintabian'; } elseif(($Marebreed == 'Paint' || $Stallbreed == 'Paint') && ($Marebreed == 'Pintabian' || $Stallbreed == 'Pintabian')){ $Foalbreed='Pintabian'; } elseif(($Marebreed == 'Pintabian' || $Stallbreed == 'Pintabian') && ($Marebreed == 'Arabian' || $Stallbreed == 'Arabian')){ $Foalbreed='Pintabian'; } elseif(($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa') && ($Marebreed == 'Shetland' || $Stallbreed == 'Shetland')){ $Foalbreed='Pony of the Americas'; } elseif(($Marebreed == 'Araloosa' || $Stallbreed == 'Araloosa') && ($Marebreed == 'Shetland' || $Stallbreed == 'Shetland')){ $Foalbreed='Pony of the Americas'; } elseif(($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa') && ($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse')){ $Foalbreed='Pony of the Americas'; } elseif(($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa') && ($Marebreed == 'Welsh Pony' || $Stallbreed == 'Welsh Pony')){ $Foalbreed='Pony of the Americas'; } elseif(($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa') && ($Marebreed == 'Welsh Cob' || $Stallbreed == 'Welsh Cob')){ $Foalbreed='Pony of the Americas'; } elseif(($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa') && ($Marebreed == 'Mustang' || $Stallbreed == 'Mustang')){ $Foalbreed='Pony of the Americas'; } elseif(($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa') && ($Marebreed == 'Kiger Mustang' || $Stallbreed == 'Kiger Mustang')){ $Foalbreed='Pony of the Americas'; } elseif(($Marebreed == 'Pony of the Americas' || $Stallbreed == 'Pony of the Americas') && ($Marebreed == 'Welsh Pony' || $Stallbreed == 'Welsh Pony')){ $Foalbreed='Pony of the Americas'; } elseif(($Marebreed == 'Pony of the Americas' || $Stallbreed == 'Pony of the Americas') && ($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa')){ $Foalbreed='Pony of the Americas'; } elseif(($Marebreed == 'Pony of the Americas' || $Stallbreed == 'Pony of the Americas') && ($Marebreed == 'Shetland' || $Stallbreed == 'Shetland')){ $Foalbreed='Pony of the Americas'; } elseif(($Marebreed == 'Pony of the Americas' || $Stallbreed == 'Pony of the Americas') && ($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse')){ $Foalbreed='Pony of the Americas'; } elseif(($Marebreed == 'Pony of the Americas' || $Stallbreed == 'Pony of the Americas') && ($Marebreed == 'Mustang' || $Stallbreed == 'Mustang')){ $Foalbreed='Pony of the Americas'; } elseif(($Marebreed == 'Pony of the Americas' || $Stallbreed == 'Pony of the Americas') && ($Marebreed == 'Kiger Mustang' || $Stallbreed == 'Kiger Mustang')){ $Foalbreed='Pony of the Americas'; } elseif(($Marebreed == 'Pony of the Americas' || $Stallbreed == 'Pony of the Americas') && ($Marebreed == 'Thoroughbred' || $Stallbreed == 'Thoroughbred')){ $Foalbreed='Pony of the Americas'; } elseif(($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse') && ($Marebreed == 'Arabian' || $Stallbreed == 'Arabian')){ $Foalbreed='Quarab'; } elseif(($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse') && ($Marebreed == 'Russian Arabian' || $Stallbreed == 'Russian Arabian')){ $Foalbreed='Quarab'; } elseif(($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse') && ($Marebreed == 'Spanish Arabian' || $Stallbreed == 'Spanish Arabian')){ $Foalbreed='Quarab'; } elseif(($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse') && ($Marebreed == 'Shagya Arabian' || $Stallbreed == ' Shagya Arabian')){ $Foalbreed='Quarab'; } elseif(($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse') && ($Marebreed == 'Straight Egyptian Arabian' || $Stallbreed == 'Straight Egyptian Arabian')){ $Foalbreed='Quarab'; } elseif(($Marebreed == 'Quarab' || $Stallbreed == 'Quarab') && ($Marebreed == 'Straight Egyptian Arabian' || $Stallbreed == 'Straight Egyptian Arabian')){ $Foalbreed='Quarab'; } elseif(($Marebreed == 'Quarab' || $Stallbreed == 'Quarab') && ($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse')){ $Foalbreed='Quarab'; } elseif(($Marebreed == 'Quarab' || $Stallbreed == 'Quarab') && ($Marebreed == 'Arabian' || $Stallbreed == 'Arabian')){ $Foalbreed='Quarab'; } elseif(($Marebreed == 'Quarab' || $Stallbreed == 'Quarab') && ($Marebreed == 'Russian Arabian' || $Stallbreed == 'Russian Arabian')){ $Foalbreed='Quarab'; } elseif(($Marebreed == 'Quarab' || $Stallbreed == 'Quarab') && ($Marebreed == 'Spanish Arabian' || $Stallbreed == 'Spanish Arabian')){ $Foalbreed='Quarab'; } elseif(($Marebreed == 'Quarab' || $Stallbreed == 'Quarab') && ($Marebreed == 'Shagya Arabian' || $Stallbreed == 'Shagya Arabian')){ $Foalbreed='Quarab'; } elseif(($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse') && ($Marebreed == 'Welsh Pony' || $Stallbreed == 'Welsh Pony')){ $Foalbreed='Quarter Pony'; } elseif(($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse') && ($Marebreed == 'Connemara' || $Stallbreed == 'Connemara')){ $Foalbreed='Quarter Pony'; } elseif(($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse') && ($Marebreed == 'Shetland' || $Stallbreed == 'Shetland')){ $Foalbreed='Quarter Pony'; } elseif(($Marebreed == 'Quarter Pony' || $Stallbreed == 'Quarter Pony') && ($Marebreed == 'Welsh Pony' || $Stallbreed == 'Welsh Pony')){ $Foalbreed='Quarter Pony'; } elseif(($Marebreed == 'Quarter Pony' || $Stallbreed == 'Quarter Pony') && ($Marebreed == 'Connemara' || $Stallbreed == 'Connemara')){ $Foalbreed='Quarter Pony'; } elseif(($Marebreed == 'Quarter Pony' || $Stallbreed == 'Quarter Pony') && ($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse')){ $Foalbreed='Quarter Pony'; } elseif(($Marebreed == 'Quarter Pony' || $Stallbreed == 'Quarter Pony') && ($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa')){ $Foalbreed='Quarter Pony'; } elseif(($Marebreed == 'Quarter Pony' || $Stallbreed == 'Quarter Pony') && ($Marebreed == 'Pony of the Americas' || $Stallbreed == 'Pony of the Americas')){ $Foalbreed='Quarter Pony'; } elseif(($Marebreed == 'Quarter Pony' || $Stallbreed == 'Quarter Pony') && ($Marebreed == 'Welsh Pony' || $Stallbreed == 'Welsh Pony')){ $Foalbreed='Quarter Pony'; } elseif(($Marebreed == 'Percheron' || $Stallbreed == 'Percheron') && ($Marebreed == 'Andalusian' || $Stallbreed == 'Andalusian')){ $Foalbreed='Spanish Norman'; } elseif(($Marebreed == 'Spanish Norman' || $Stallbreed == 'Spanish Norman') && ($Marebreed == 'Andalusian' || $Stallbreed == 'Andalusian')){ $Foalbreed='Spanish Norman'; } elseif(($Marebreed == 'Percheron' || $Stallbreed == 'Percheron') && ($Marebreed == 'Spanish Norman' || $Stallbreed == 'Spanish Norman')){ $Foalbreed='Spanish Norman'; } elseif(($Marebreed == 'Friesian' || $Stallbreed == 'Friesian') && ($Marebreed == 'Andalusian' || $Stallbreed == 'Andalusian')){ $Foalbreed='Warlander'; } elseif(($Marebreed == 'Warlander' || $Stallbreed == 'Warlander') && ($Marebreed == 'Andalusian' || $Stallbreed == 'Andalusian')){ $Foalbreed='Warlander'; } elseif(($Marebreed == 'Friesian' || $Stallbreed == 'Friesian') && ($Marebreed == 'Warlander' || $Stallbreed == 'Warlander')){ $Foalbreed='Warlander';} else{ $Foalbreed="$Marebreed x $Stallbreed"; } //echo "$Foalbreed"; ?> <br><br> <?php $sql="SELECT * FROM colour WHERE coloura='$Stallcolor' OR coloura='$Marecolor' and colourb='$Marecolor' OR colourb='$Stallcolor' ORDER BY RAND() limit 0,1 "; $result=mysql_query($sql); while($r=mysql_fetch_array($result)){ $Foalcolor=$r["result"]; //echo "$Foalcolor"; } $sql="SELECT * FROM gender ORDER BY RAND() limit 0,1 "; $result=mysql_query($sql); while($r=mysql_fetch_array($result)){ $FoalGender=$r["gender"]; //echo "$FoalGender"; } $number1 = $MareSpeed + $StallSpeed; $FoalSpeed = $number1 / 8; //echo "$FoalSpeed"; $number1 = $MareScope + $StallScope; $FoalScope= $number1 / 8; //echo "$FoalScope"; $number1 = $MareEndurance + $StallEndurance; $FoalEndurance = $number1 / 8; //echo "$FoalEndurance"; $number1 = $MarePower + $StallPower; $FoalPower = $number1 / 8; //echo "$FoalPower"; $number1 = $MareTemperment + $StallTemperment; $FoalTemperment = $number1 / 8; //echo "$FoalTemperment"; $number1 = $MareObedience + $StallObedience; $FoalObedience = $number1 / 8; //echo "$FoalObedience"; $number1 = $MareSociability + $StallSociability; $FoalSociability = $number1 / 8; //echo "$FoalSociability"; $number1 = $MareIntelligence + $StallIntelligence; $FoalIntelligence= $number1 / 8; //echo "$FoalIntelligence"; $number1 = $MareTemperament + $StallTemperament; $FoalTemperament=round( $number1 / 2 ); //echo "$FoalTemperament"; $number1 = $MareLegs + $StallLegs; $FoalLegs=round( $number1 / 2 ); //echo "$FoalLegs"; $number1 = $MareBack + $StallBack; $FoalBack=round( $number1 / 2 ); //echo "$FoalBack"; $number1 = $MareHead + $StallHead; $FoalHead=round( $number1 / 2 ); //echo "$FoalHead"; $number1 = $MareNeck + $StallNeck; $FoalNeck=round( $number1 / 2 ); //echo "$FoalNeck"; ?> <br><br> <?php // Horse New Pedigree $number = $MarePedigree + $StallPedigree; if($number == ''){ $Pedigree = rand($minRandPedigree,$maxRandPedigree); }else{ $Pedigree =round( $number / 6 ); } //echo "$Pedigree"; if ($MarePedigree and $StallPedigree == '0' ); $random_number = rand(10,100); //echo "$random_number"; $sql="INSERT INTO horsedata ( Name, Owner, Height, Breed, Gender, Registrations, Exp, Points, Records, Speed, Scope, Power, Obedience, Sociability, Sire, Dam, Foals, Awards, Grading, Image, Hay, Grain, Vet, Shoes, Exercise, Grooming, DOB, Endurance, Intelligence, Color, temperament, legs, back, neck, head, pedigree )VALUES( 'New Foal', '$Owner', '$Height', '$Foalbreed', '$FoalGender', 'Not Registered', '0', '0', 'none', '$FoalSpeed', '$FoalScope', '$FoalPower', '$FoalObedience', '$FoalSociability', '$stall', '$mare', 'None Yet', 'This horse has not won any awards', 'Not Graded', 'default.jpg', 'No', 'No', 'No', 'No', 'No', 'No', '0', '$FoalEndurance', '$FoalIntelligence', '$Foalcolor', '$FoalTemperment', '$FoalLegs', '$FoalBack', '$FoalNeck', '$FoalHead', '$Pedigree' )"; if (!mysql_query($sql)) { die('Error: ' . mysql_error()); } echo "Foal Created Successfully with above stats"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/135021-breeding-script-help/#findComment-704203 Share on other sites More sharing options...
DeanWhitehouse Posted December 2, 2008 Share Posted December 2, 2008 Posting the code isn't going to help :s Quote Link to comment https://forums.phpfreaks.com/topic/135021-breeding-script-help/#findComment-704205 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.