Page 2 of 2
Posted: Wed Jun 21, 2006 4:29 pm
by bdlang
Milan wrote:now when i compare that with my code, i am just depressed
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.
Posted: Wed Jun 21, 2006 4:43 pm
by Milan
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:
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());
Posted: Wed Jun 21, 2006 5:21 pm
by bdlang
Yeah, that was my bad. I forgot a 'break' after the case 'medb': statement. If you look at my original post, I edited the code.
Posted: Wed Jun 21, 2006 5:28 pm
by Milan
LOL !
i should get some sleep, i was looking at it for like an hour.