Feh. Don't feel bad about it at all, as the Perl motto attests: TMTOWTDI (there's more than one way to do it) and somebody else will always come up with a quicker, better method. You'll get there, it takes time. Your way was fine, I just thought a quick example of a (potentially) more efficient method was warranted.Milan wrote:now when i compare that with my code, i am just depressed![]()
Weird things with if statement or "how to lose your min
Moderator: General Moderators
I guess you are right,
I just want to say thanks for all the help.
Now it writes in the table but it writes "5001000"
this is the code:
I just want to say thanks for all the help.
Now it writes in the table but it writes "5001000"
this is the code:
Code: Select all
$sess = $_GET['session'];
mysql_select_db($database_pickageek, $pickageek);
$query3= 'UPDATE `awapr` SET `pricemin` = ';
switch($row_Recordset2['ptype']) {
case 'unkn':
$query3.= 1;
break;
case 'smlb':
$query3.= 100;
break;
case 'medb':
$query3.= 500;
case 'bigb':
$query3.= 1000;
break;
default:
$query3.= 1;
}
$query3.= " WHERE `session` = '{$sess}'";
mysql_query($query3) or die(mysql_error());