two table update
Posted: Thu Nov 17, 2005 9:52 pm
I want to have a IF after my update command that looks like this:
But $tovalue is from a different table than the cortval1-3
Can i do it like this???
Code: Select all
if($cortval1>0,$cortval2>0,$cortval3>0){
$tovalue='$tovalue+$cortval1+$cortval2+$cortval3';
}
elseif($cortval1>0,$cortval2>0){
$tovalue='$tovalue+$cortval1+$cortval2';
}
elseif($cortval1>0){
$tovalue='$tovalue+$cortval1';
}Can i do it like this???
Code: Select all
elseif($cortval1>0){
$sql = "UPDATE sam_artikel SET $tovalue=$tovalue+$conrtval1";
mysql_query($sql);
}