Weird result from query...?
| From: | Ryan A | Date: | Fri, 27 Feb 2004 01:20:13 +0000 |
| Subject: | Weird result from query...? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-178977@lists.php.net to get a copy of this message | ||
Hi,
Just been getting some weird results from a query...can anybody tell me
why..?
Basically am sending 3 variables via a link on the page...
http://localhost/show_accounts.php?o=8927437717300145&n=shane&p=4.78
which runs the sql in show_accounts.php:
SELECT *,now()-0 from ".$tcname." where oorder='".$o."' and
nname='".$n."'
and total='$p'
(globals is off and i am assigning the variables on top of the page. eg:
$o=$_GET['o'],)
my tables structure is:
oorder varchar(20) // varchar because I will have dashes and underscores in
it.
nname varchar 60
total float(6,2)
I have checked the database and I DO have a record that matches the SQL
above but it does not
return a result _unless_ the decimal spaces have two zeros in it,
eg:
4.00 works fine
1.00 works fine
77.00 works fine
4.77 does not work
1.42 does not work
etc
I have taken out the purchase amount and everythings running fine...but am
just curious as to what was
actually causing the problem...any ideas?
Cheers,
-Ryan