Topic: Could anyone tell me how to...? (Read 1377 times)
OMG!I am geek
Gender:
Posts: 55
366 credits Members referred : 0
my day will come..
« Reply #20 on: Jan 25, 2007, 03:54:22 PM »
Alright, it happened that I translated the file to english to post it here, but it seems that I forgot to translate back to spanish a variable... my bad. Anyway, the query is still not working. S:
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6301
38632 credits Members referred : 374
OMG!I am geek
Gender:
Posts: 55
366 credits Members referred : 0
my day will come..
« Reply #26 on: Jan 25, 2007, 04:45:29 PM »
For some reason, if I use sprintf on 'saldo' column when I register a payment of 100.00 its gets off 200.00 from the balance. If I input 50.00 it gets 100.00 off, if I input 150.50 it gets 200 off. It seems like it's taking the total to the closer integer.
MySQL 'saldo' column properties..
Code:
`saldo` DECIMAL(10,2) NOT NULL,
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6301
38632 credits Members referred : 374
It's time to use PHP5!
« Reply #27 on: Jan 25, 2007, 04:47:48 PM »
in this case you need this one:
<?php $sql= sprintf("UPDATE clientes SET saldo = saldo - %f WHERE id_cliente = '%s'", $_GET['monto'], $id_cliente);
OMG!I am geek
Gender:
Posts: 55
366 credits Members referred : 0
my day will come..
« Reply #28 on: Jan 25, 2007, 04:51:28 PM »
I would like to know what are those letters about. I guess they define arguments or something... anyway... last query does take the decimals exactly, BUT every amount I input it gets doubled.
( any amount ) * ( 2 )
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6301
38632 credits Members referred : 374
I would like to know what are those letters about. I guess they define arguments or something... anyway... last query does take the decimals exactly, BUT every amount I input it gets doubled.