Posted 28 August 2006 - 01:17 PM
mysql_query("UPDATE table SET var=var+'$var' FROM somewhere");
For some reason only Internet Explorer makes the math correct, other browsers always return a bit higher number than they should (ie 1+1 = 5). I'm quite lost...
Posted 28 August 2006 - 01:56 PM
<?php $var = 1; mysql_query("UPDATE tableName SET var = var + $var WHERE something = something"); ?>
Posted 28 August 2006 - 02:05 PM
No, the data isn't coming from a form, it's a number that is increased in a loop. But thanks, I'll try it without no single quotes. I can test it now though, as I'm at work, and all this comp has is IE...
To be more spesific, the number is a calculation actually, $var = round($var2 / $var3, 0);
Posted 29 August 2006 - 10:02 PM
$var = $var2 + 10;
mysql_query("UPDATE table SET var = $var WHERE some=thing ") or die('Query failed: ' . mysql_error());
the echo returns 16, but the update makes it 18... And though it seems extremely odd, IE just makes it right, and firefox doesn't. So much for it being a serverside language
$var2 = -1 * round(($var3 * $var4) / $var5, 0);
Oh and with or without ' ' seems to make no diffrence...
Posted 31 August 2006 - 11:45 AM
Posted 31 August 2006 - 01:49 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users