Welcome Guest, Not a member yet? Register   Sign In
Storing negative values in MySQL
#4

[eluser]megabyte[/eluser]
Ben,


What I am talking about is an inventory transaction table.

so yes you would have positive and negative values.

positive values would be purchases

negative values would be when you remove it.

I also have to use FIFO which is another problem, and I have a solution hopefully that works.

As for making sure I store correct nagative values, I am now using this regex in the form validation:

Code:
preg_match("/^(\d|-)?(\d|,)*\.?\d*$/", $str);

this makes sure it is only a negative or positive number with a single decimal point


Messages In This Thread
Storing negative values in MySQL - by El Forum - 01-15-2010, 03:39 PM
Storing negative values in MySQL - by El Forum - 01-15-2010, 05:16 PM
Storing negative values in MySQL - by El Forum - 01-15-2010, 05:17 PM
Storing negative values in MySQL - by El Forum - 01-15-2010, 05:23 PM
Storing negative values in MySQL - by El Forum - 01-16-2010, 02:30 AM
Storing negative values in MySQL - by El Forum - 01-16-2010, 04:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB