Jump to content


Photo

Newbie question


  • Please log in to reply
2 replies to this topic

#1 Relaxer

Relaxer
  • Members
  • Pip
  • Newbie
  • 4 posts
  • LocationPhilippines

Posted 30 April 2003 - 08:55 AM

Hi, im making a small inventory using mysql. In my $price i choose decimal and 10,2 in the length.

My interface is made in HTML code.

The problem is when i input the price, the data is not shown in the db. all it shows is the default 0.00. Help me please.. Thanks in advance
\"Work like you don\'t need money. [br] Love like you\'ve never been hurt. [br] Dance like nobody\'s watching.\" [br] - Jessica

#2 barbatruc

barbatruc
  • Members
  • PipPip
  • Member
  • 28 posts
  • LocationMontreal, Quebec, Canada

Posted 30 April 2003 - 11:54 AM

How do you proceed for your Insert queries ?

You should have something like:
INSERT INTO `table`

(`field`) 

VALUES

(\'5\');
If `field` is a decimal field and has a length of 10,2 this will insert value 5.00 into the database. In MySQL, even if you place values between \', values will be converted to the right format. Also, be sure to use the \".\", not the \",\" to separate the decimal part from the integer part.

JP.
Unfortunately, PHP \'empowered every moron with a copy of Windows notepad to be \"web programmers\". (...) Give PHP a real INFRASTRUCTURE. Use PEAR!!!\'

#3 Relaxer

Relaxer
  • Members
  • Pip
  • Newbie
  • 4 posts
  • LocationPhilippines

Posted 30 April 2003 - 10:19 PM

Thanks! I\'ll give it a try.
\"Work like you don\'t need money. [br] Love like you\'ve never been hurt. [br] Dance like nobody\'s watching.\" [br] - Jessica




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users