As far as i know, the copy paste function doesn't miss things, however this script that used to work doesn't know, and it does't return any errors, so i know it's not the IF/ELSE statements, it's the mysql update, but im not sure what to change since it isn't giving me any errors.
EDIT: nvm, in looking at my submission, the answer hit me. Sry to waste time.
Interesting problem
Moderator: General Moderators
-
InnerShadow
- Forum Commoner
- Posts: 37
- Joined: Thu Nov 10, 2005 10:44 pm
- Location: US
-
InnerShadow
- Forum Commoner
- Posts: 37
- Joined: Thu Nov 10, 2005 10:44 pm
- Location: US
-
InnerShadow
- Forum Commoner
- Posts: 37
- Joined: Thu Nov 10, 2005 10:44 pm
- Location: US
here it is if you want it:
Code: Select all
<?php
$LResource = $_POST['LResource'];
if($ID == "United States" or "Great Britain" or "France" or "Spain"){
$Check = "yes";
} else if($ID == "Nicaragua"){
if($LResource == "Timber" or "Fruit" or "Vegetables" or "Sugar" or "Tobacco" or "Gold"){
$Check = "yes";
} else {
$Check = "no";
}//end if
} else if($ID == "Hawaii"){
if($LResource == "Timber" or "Fruit" or "Vegetables" or "Sugar"){
$Check = "yes";
} else {
$Check = "no";
}//end if
} else if($ID == "Panama"){
if($LResource == "Iron" or "Timber" or "Fruit" or "Vegetables" or "Sugar" or "Tobacco" or "Silver" or "Gold"){
$Check = "yes";
} else {
$Check = "no";
}//end if
} else if($ID == "Jamaica"){
if($LResource == "Fruit" or "Vegetables" or "Cotton" or "Sugar" or "Tobacco" or "Silver"){
$Check = "yes";
} else {
$Check = "no";
}//end if
} else if($ID == "India"){
if($LResource == "Coal" or "Iron" or "Timber" or "Vegetables" or "Cotton" or "Silver"){
$Check = "yes";
} else {
$Check = "no";
}//end if
} else if($ID == "Sudan"){
if($LResource == "Coal" or "Cotton" or "Sugar" or "Tobacco" or "Silver" or "Gold"){
$Check = "yes";
} else {
$Check = "no";
}//end if
} else if($ID == "Libya"){
if($LResource == "Iron" or "Cotton" or "Sugar" or "Tobacco" or "Silver" or "Gold"){
$Check = "yes";
} else {
$Check = "no";
}//end if
} else if($ID == "Algeria"){
if($LResource == "Cotton" or "Sugar" or "Tobacco" or "Silver" or "Gold"){
$Check = "yes";
} else {
$Check = "no";
}//end if
} else if($ID == "Vietnam"){
if($LResource == "Timber" or "Fruit" or "Cotton" or "Sugar" or "Tobacco"){
$Check = "yes";
} else {
$Check = "no";
}//end if
} else if($ID == "Costa Rica"){
if($LResource == "Fruit" or "Vegetables" or "Sugar" or "Tobacco" or "Gold"){
$Check = "yes";
} else {
$Check = "no";
}//end if
} else if($ID == "Philippines"){
if($LResource == "Coal" or "Iron" or "Timber" or "Fruit" or "Vegetables" or "Sugar" or "Tobacco" or "Gold"){
$Check = "yes";
} else {
$Check = "no";
}//end if
} else if($ID == "China"){
if($LResource == "Coal" or "Iron" or "Timber" or "Fruit" or "Vegetables" or "Cotton" or "Sugar" or "Gold"){
$Check = "yes";
} else {
$Check = "no";
}//end if
} else if($ID == "Puerto Rico"){
if($LResource == "Fruit" or "Vegetables" or "Cotton" or "Sugar" or "Tobacco"){
$Check = "yes";
} else {
$Check = "no";
}//end if
} else if($ID == "Cuba"){
if($LResource == "Timber" or "Fruit" or "Vegetables" or "Cotton" or "Sugar" or "Tobacco" or "Gold"){
$Check = "yes";
} else {
$Check = "no";
}//end if
}//end if
if($Check == "yes"){
$conn = mysql_connect("localhost", "root", "") or die('Could not connect to the database: '.mysql_error());
mysql_select_db("countries", $conn) or die('Could not select the database: '.mysql_error());
$sql = "update bonuses set LargePlantation = '$LResource' where convert(country using utf8) = '$ID' limit 1";
$res = mysql_query($sql) or die(mysql_error().'<p>SQL:<br />'.$sql.'</p>');
print "Resource Augmented";
} else {
print "you can't augment what you don't have";
}//end if
?>-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
-
InnerShadow
- Forum Commoner
- Posts: 37
- Joined: Thu Nov 10, 2005 10:44 pm
- Location: US