Jump to content

[SOLVED] Another mysql insertion issue.


kendallkamikaze

Recommended Posts

I just was able to have someone solve my last issue that was VERY similar to this but now I need to figure out why its not inserting the image. I used the same code, which should have worked and I've changed all the right variables...that I can tell but its not working :/

 

<?php 

$color = $_POST[Foalcolor];

switch($color) {
case "Bay": $img = "horsecolors/Bay.jpg";break;
case "White": $img = "horsecolors/White.jpg";break;
case "Black": $img = "horsecolors/Black.jpg";break;
case "Bay Roan": $img = "horsecolors/BayRoan.jpg";break;
case "Blue Roan": $img = "horsecolors/BlueRoan.jpg";break;
case "Liver Chestnut": $img = "horsecolors/LiverChestnut.jpg";break;
case "Chestnut": $img = "horsecolors/Chestnut.jpg";break;
case "Grey": $img = "horsecolors/Grey.jpg";break;
case "Dapple Grey": $img = "horsecolors/DappleGrey.jpg";break;
case "Fleabitten Grey": $img = "horsecolors/FleabittenGrey.jpg";break;
case "Dun": $img = "horsecolors/Dun.jpg";break;
case "Palomino": $img = "horsecolors/Palomino.jpg";break;
case "Red Roan": $img = "horsecolors/RedRoan.jpg";break;
case "Piebald": $img = "horsecolors/Piebald.jpg";break;
case "Skewbald": $img = "horsecolors/ChestnutPaint.jpg";break;
case "Tri-colored": $Image = "horsecolors/BayPaint.jpg";break;
case "Appaloosa Pattern": $img = "horsecolors/BlackAppaloosa.jpg";break;
case "Brindle": $img = "horsecolors/Brindle.jpg";break;
case "Buckskin": $img = "horsecolors/Buckskin.jpg";break;
case "Champagne": $img = "horsecolors/Champagne.jpg";break;
case "Cremello": $img = "horsecolors/Cremello.jpg";break;
case "Dunalino": $img = "horsecolors/Dunalino.jpg";break;
case "Grulla": $img = "horsecolors/Grulla.jpg";break;
case "Perlino": $img = "horsecolors/Perlino.jpg";break;
case "Red Dun": $img = "horsecolors/RedDun.jpg";break;
case "Silver Dapple": $img = "horsecolors/SilverDapple.jpg";break;
default: $img = "";break;
}

$sql="INSERT INTO horsedata (
Name, 
Owner, 
Height, 
Breed, 
Gender, 
Registrations, 
Exp, 
Points, 
Records, 
Speed, 
Scope, 
Power, 
Obedience, 
Sociability, 
Dam, 
Sire, 
Foals, 
Awards,
Grading,
Hay,
Grain,
Vet,
Shoes,
Exercise,
Grooming,
DOB,
Endurance,
Intelligence,
Color,
temperament,
legs,
back,
neck,
head,
pedigree,
Image
)VALUES(
'New Foal',
'$Owner',
'$Height',
'$Foalbreed',
'$FoalGender',
'Not Registered',
'0',
'0',
'none',
'$FoalSpeed',
'$FoalScope',
'$FoalPower',
'$FoalObedience',
'$FoalSociability',
'$mare',
'$stall',
'None Yet',
'This horse has not won any awards',
'Not Graded',
'No',
'No',
'No',
'No',
'No',
'No',
'0',
'$FoalEndurance',
'$FoalIntelligence',
'$Foalcolor',
'$FoalTemperment',
'$FoalLegs',
'$FoalBack',
'$FoalNeck',
'$FoalHead',
'$Pedigree', 
'".$img."' 
)";



if (!mysql_query($sql))
{
die('Error: ' . mysql_error());
}
echo "Foal Created Successfully with above stats";
?>

Link to comment
Share on other sites

nope, everything works...well as far as i know theres no error? everything but the image inserts...but thats only 1/5 of the entire code...

 

heres the entire code...the first code i posted is at the end of this whole thing

<?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;
$minRand = 10;
$maxRand = 98;

$foal=$_POST['foalid'];
$sql="SELECT * FROM horsedata WHERE id='$foal'";
$result=mysql_query($sql);

$mare=trim($_POST['mareid']);

$sql="SELECT * FROM horsedata WHERE id='$mare'";
$result=mysql_query($sql);
// Mare 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"];
}
mysql_query("UPDATE horsedata SET Pregnant = 'No' WHERE id = '$mare'");

$stall=trim($_POST['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"];
}



//$Pedigree = round((($MareBack+$StallBack)+($MareNeck+$StallNeck)+($MareLegs+$StallLegs)+($MareHead+$StallHead)+($MareTemperment+$StallTemperment)) / 10);

// 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 Horse';

}		elseif(($Marebreed == 'Irish Draught' || $Stallbreed == 'Irish Draught') && ($Marebreed == 'Connemara' || $Stallbreed == 'Connemara')){
$Foalbreed='Irish Sport Horse';

}		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 == 'Thoroughbred' || $Stallbreed == 'Thoroughbred')){
$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';}

	elseif(($Marebreed == 'Akhal Teke' || $Stallbreed == 'Akhal Teke') && ($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa')){
$Foalbreed='Nez Perce';}


	elseif(($Marebreed == 'Andalusian' || $Stallbreed == 'Andalusian') && ($Marebreed == 'Paint' || $Stallbreed == 'Paint')){
$Foalbreed='Azteca';}


	elseif(($Marebreed == 'Arabian' || $Stallbreed == 'Arabian') && ($Marebreed == 'Ploish Arabian' || $Stallbreed == 'Polish Arabian')){
$Foalbreed='Arabian';}


	elseif(($Marebreed == 'Straight Egyptian Arabian' || $Stallbreed == 'Straight Egyptian Arabian') && ($Marebreed == 'Polish Arabian' || $Stallbreed == 'Polish Arabian')){
$Foalbreed='Arabian';}

	elseif(($Marebreed == 'Straight Egyptian Arabian' || $Stallbreed == 'Straight Egyptian Arabian') && ($Marebreed == 'Russian Arabian' || $Stallbreed == 'Russian Arabian')){
$Foalbreed='Arabian';}

	elseif(($Marebreed == 'Straight Egyptian Arabian' || $Stallbreed == 'Straight Egyptian Arabian') && ($Marebreed == 'Spanish Arabian' || $Stallbreed == 'Spanish Arabian')){
$Foalbreed='Arabian';}



	elseif(($Marebreed == 'Polish Arabian' || $Stallbreed == 'Polish Arabian') && ($Marebreed == 'Russian Arabian' || $Stallbreed == 'Russian Arabian')){
$Foalbreed='Arabian';}

	elseif(($Marebreed == 'Polish Arabian' || $Stallbreed == 'Polish Arabian') && ($Marebreed == 'Spanish Arabian' || $Stallbreed == 'Spanish Arabian')){
$Foalbreed='Arabian';}


	elseif(($Marebreed == 'Paso Fino' || $Stallbreed == 'Paso Fino') && ($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa')){
$Foalbreed='Tiger Horse';}

	elseif(($Marebreed == 'Peruvian Paso' || $Stallbreed == 'Peruvian Paso') && ($Marebreed == 'Appaloosa' || $Stallbreed == 'Appaloosa')){
$Foalbreed='Tiger Horse';}

else{
$Foalbreed="$Marebreed x $Stallbreed"; 
}
echo"$Foalbreed";
?>

<br><br>

<?php

$sql="SELECT * FROM colour WHERE coloura='$Stallcolor' and colourb='$Marecolor' 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;  
if($number1 == ''){
$FoalTemperment = rand($minRand,$maxRand);
}else{
$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 = $MareTemperment + $StallTemperment;
if($number1 == ''){
$FoalTemperment = rand($minRand,$maxRand);
echo 'rand';
}else{ 
$FoalTemperment=round( $number1 / 2 ); 
echo 'round';
}
echo"<p>FoalTemp: $FoalTemperment</p>";

$number1 = $MareLegs + $StallLegs; 
if($number1 == ''){
$FoalLegs = rand($minRand,$maxRand);
}else{
$FoalLegs=round( $number1 / 2 );
}
echo"<p>FoalLegs: $FoalLegs";

$number1 = $MareBack + $StallBack; 
if($number1 == ''){
$FoalBack = rand($minRand,$maxRand);
}else{
$FoalBack=round( $number1 / 2 ); 
}
echo"<p>FoalBack: $FoalBack"; 

$number1 = $MareHead + $StallHead; 
if($number1 == ''){
$FoalHead = rand($minRand,$maxRand);
}else{
$FoalHead=round( $number1 / 2 ); 
}
echo"<p>FoalHead: $FoalHead"; 

$number1 = $MareNeck + $StallNeck; 
if($number1 == ''){
$FoalNeck = rand($minRand,$maxRand);
}else{
$FoalNeck=round( $number1 / 2 ); 
}
echo"<p>FoalNeck: $FoalNeck"; 

?>

<br><br>

<?php

// Horse New Pedigree
//$number = $MarePedigree + $StallPedigree; 
//if($number == '' || $MarePedigree == '' || $StallPedigree == ''){
//$Pedigree = rand($minRandPedigree,$maxRandPedigree);
//}else{
//$Pedigree =round( $number / 6 );
$Pedigree = round((($MareBack+$StallBack)+($MareNeck+$StallNeck)+($MareLegs+$StallLegs)+($MareHead+$StallHead)+($MareTemperment+$StallTemperment)) / 10);
//}

//$Pedigree = round(((97+73)+(91+32)+(93+82)+(21+69)+(54+46)) / 10);

echo"<p>Pedigree: $Pedigree</p>"; 

if ($MarePedigree and $StallPedigree == '0' ); 

$random_number = rand(10,95);
echo"$random_number";
?>

<?php 

$color = $_POST[Foalcolor];

switch($color) {
case "Bay": $img = "horsecolors/Bay.jpg";break;
case "White": $img = "horsecolors/White.jpg";break;
case "Black": $img = "horsecolors/Black.jpg";break;
case "Bay Roan": $img = "horsecolors/BayRoan.jpg";break;
case "Blue Roan": $img = "horsecolors/BlueRoan.jpg";break;
case "Liver Chestnut": $img = "horsecolors/LiverChestnut.jpg";break;
case "Chestnut": $img = "horsecolors/Chestnut.jpg";break;
case "Grey": $img = "horsecolors/Grey.jpg";break;
case "Dapple Grey": $img = "horsecolors/DappleGrey.jpg";break;
case "Fleabitten Grey": $img = "horsecolors/FleabittenGrey.jpg";break;
case "Dun": $img = "horsecolors/Dun.jpg";break;
case "Palomino": $img = "horsecolors/Palomino.jpg";break;
case "Red Roan": $img = "horsecolors/RedRoan.jpg";break;
case "Piebald": $img = "horsecolors/Piebald.jpg";break;
case "Skewbald": $img = "horsecolors/ChestnutPaint.jpg";break;
case "Tri-colored": $img = "horsecolors/BayPaint.jpg";break;
case "Appaloosa Pattern": $img = "horsecolors/BlackAppaloosa.jpg";break;
case "Brindle": $img = "horsecolors/Brindle.jpg";break;
case "Buckskin": $img = "horsecolors/Buckskin.jpg";break;
case "Champagne": $img = "horsecolors/Champagne.jpg";break;
case "Cremello": $img = "horsecolors/Cremello.jpg";break;
case "Dunalino": $img = "horsecolors/Dunalino.jpg";break;
case "Grulla": $img = "horsecolors/Grulla.jpg";break;
case "Perlino": $img = "horsecolors/Perlino.jpg";break;
case "Red Dun": $img = "horsecolors/RedDun.jpg";break;
case "Silver Dapple": $img = "horsecolors/SilverDapple.jpg";break;
default: $img = "";break;
}

$sql="INSERT INTO horsedata (
Name, 
Owner, 
Height, 
Breed, 
Gender, 
Registrations, 
Exp, 
Points, 
Records, 
Speed, 
Scope, 
Power, 
Obedience, 
Sociability, 
Dam, 
Sire, 
Foals, 
Awards,
Grading,
Hay,
Grain,
Vet,
Shoes,
Exercise,
Grooming,
DOB,
Endurance,
Intelligence,
Color,
temperament,
legs,
back,
neck,
head,
pedigree,
Image)
VALUES(
'New Foal',
'$Owner',
'$Height',
'$Foalbreed',
'$FoalGender',
'Not Registered',
'0',
'0',
'none',
'$FoalSpeed',
'$FoalScope',
'$FoalPower',
'$FoalObedience',
'$FoalSociability',
'$mare',
'$stall',
'None Yet',
'This horse has not won any awards',
'Not Graded',
'No',
'No',
'No',
'No',
'No',
'No',
'0',
'$FoalEndurance',
'$FoalIntelligence',
'$Foalcolor',
'$FoalTemperment',
'$FoalLegs',
'$FoalBack',
'$FoalNeck',
'$FoalHead',
'$Pedigree', 
'".$img."' 
)";

if (!mysql_query($sql))
{
die('Error: ' . mysql_error());

}
echo "Foal Created Successfully with above stats";
?>

Link to comment
Share on other sites

I figured it out!

 

<?php 

$_POST[Foalcolor];

switch($Foalcolor) {
case "Bay": $img = "horsecolors/Bay.jpg";break;
case "White": $img = "horsecolors/White.jpg";break;
case "Black": $img = "horsecolors/Black.jpg";break;
case "Bay Roan": $img = "horsecolors/BayRoan.jpg";break;
case "Blue Roan": $img = "horsecolors/BlueRoan.jpg";break;
case "Liver Chestnut": $img = "horsecolors/LiverChestnut.jpg";break;
case "Chestnut": $img = "horsecolors/Chestnut.jpg";break;
case "Grey": $img = "horsecolors/Grey.jpg";break;
case "Dapple Grey": $img = "horsecolors/DappleGrey.jpg";break;
case "Fleabitten Grey": $img = "horsecolors/FleabittenGrey.jpg";break;
case "Dun": $img = "horsecolors/Dun.jpg";break;
case "Palomino": $img = "horsecolors/Palomino.jpg";break;
case "Red Roan": $img = "horsecolors/RedRoan.jpg";break;
case "Piebald": $img = "horsecolors/Piebald.jpg";break;
case "Skewbald": $img = "horsecolors/ChestnutPaint.jpg";break;
case "Tri-colored": $img = "horsecolors/BayPaint.jpg";break;
case "Appaloosa Pattern": $img = "horsecolors/BlackAppaloosa.jpg";break;
case "Brindle": $img = "horsecolors/Brindle.jpg";break;
case "Buckskin": $img = "horsecolors/Buckskin.jpg";break;
case "Champagne": $img = "horsecolors/Champagne.jpg";break;
case "Cremello": $img = "horsecolors/Cremello.jpg";break;
case "Dunalino": $img = "horsecolors/Dunalino.jpg";break;
case "Grulla": $img = "horsecolors/Grulla.jpg";break;
case "Perlino": $img = "horsecolors/Perlino.jpg";break;
case "Red Dun": $img = "horsecolors/RedDun.jpg";break;
case "Silver Dapple": $img = "horsecolors/SilverDapple.jpg";break;
default: $img = "";break;
}

$sql="INSERT INTO horsedata (
Name, 
Owner, 
Height, 
Breed, 
Gender, 
Registrations, 
Exp, 
Points, 
Records, 
Speed, 
Scope, 
Power, 
Obedience, 
Sociability, 
Dam, 
Sire, 
Foals, 
Awards,
Grading,
Hay,
Grain,
Vet,
Shoes,
Exercise,
Grooming,
DOB,
Endurance,
Intelligence,
Color,
temperament,
legs,
back,
neck,
head,
pedigree,
Image)
VALUES(
'New Foal',
'$Owner',
'$Height',
'$Foalbreed',
'$FoalGender',
'Not Registered',
'0',
'0',
'none',
'$FoalSpeed',
'$FoalScope',
'$FoalPower',
'$FoalObedience',
'$FoalSociability',
'$mare',
'$stall',
'None Yet',
'This horse has not won any awards',
'Not Graded',
'No',
'No',
'No',
'No',
'No',
'No',
'0',
'$FoalEndurance',
'$FoalIntelligence',
'$Foalcolor',
'$FoalTemperment',
'$FoalLegs',
'$FoalBack',
'$FoalNeck',
'$FoalHead',
'$Pedigree', 
'".$img."' 
)";

if (!mysql_query($sql))
{
die('Error: ' . mysql_error());

}
echo "Foal Created Successfully with above stats";
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.