Page 1 of 1

[SOLVED] Disallowed implicit conversion...

Posted: Wed Jan 26, 2005 11:01 am
by snicolas
Grrrrrrrrrrrrrr.....
PHP & SQL
Getting this error when trying to insert value in SQL.
The data type of the column is money

my query is simple
$thecash= "5.55";
$sql=Insert into a (price) values('convert(money,$thecash)');

what's wrong????

s

Posted: Wed Jan 26, 2005 11:08 am
by feyd
total guess here: maybe it's your quoting the function call?

Posted: Wed Jan 26, 2005 11:15 am
by snicolas
it's nice to guess, but it's not really helpfull this kind of answer...
especially when you're stuck...
I am still learning, not a pro and wish other coders "share" their huge knowledge....
Do you have to beg now?

s

Posted: Wed Jan 26, 2005 11:20 am
by feyd
I have no idea what SQL language you're using... Because there are so many, I'm not going to go look at all of them.. help us out here.

Posted: Wed Jan 26, 2005 11:22 am
by snicolas
mmm.
PHP and SQL SERVER?

Posted: Wed Jan 26, 2005 11:38 am
by feyd
did you even try removing the quotes? Cause that sure looks like what's needed.

Posted: Wed Jan 26, 2005 11:41 am
by snicolas
thank you, that, indeed, fixed the problem...