und zwar weiss ich nicht richtig wie ich die IF - ELSE Anweisung in meinem INSERT script richtig schreibe. Ich habs jetzt so versucht:
	
Klappt aber so nicht ganz =)
hoffe jemand kann mir helfen.
thx
joe
					PHP-Code:
	
	
<?
error_reporting(E_ALL);
$db = mysql_connect("localhost","root","") or die ("MySQL-Fehler: " . mysql_error());
mysql_select_db("safe",$db) or die ("MySQL-Fehler: " . mysql_error());
$hull = $_POST["hull"];
$contramount = $_POST["contramount"];
if ($vat=='J'){
    $tovalue = ('$contrvalue'*'$exrate'*'1.17');
}
else{
    $tovalue = ('$contrvalue'*'$exrate');
}
$classification = $_POST["classification"];
if ($vat=='J'){
    vat=='J';
}
    else{
    vat=='N';
    }
$currency = $_POST["currency"];
$exrate = $_POST["exrate"];
$sql = "INSERT INTO sam_bestellung (hull, contramount, tovalue, classification, vat, 
currency, exrate)
VALUES ('$hull','$contramount','$tovalue','$classification','$vat',
'$currency','$exrate')";
if (mysql_query($sql,$db)) {
echo "Dataset added!<br>
}
else
echo "Dataset was not added - try again!";
?>
hoffe jemand kann mir helfen.
thx
joe
 
          
 Moderator
 Moderator
Kommentar