Please read the syntax in the documentation
Syntax for Decimal
Name DECIMAL(M,D) // M>=D
Handling Decimal format
Collapse
X
-
When I do that, the table is not created, look at the code below.
Code:$Isotope = "CREATE TABLE Isotope ( isotope_id int(2) NOT NULL auto_increment, isotope_name varchar(50) NOT NULL, state int(1) NOT NULL, unit varchar(10) NOT NULL, min_value decimal(3,6) NOT NULL, max_value decimal(3,6) NOT NULL, PRIMARY KEY (isotope_id) )"; $results = mysql_query($Isotope);
Leave a comment:
-
Handling Decimal format
I have the following create statement
but when I look at the data field using phpadmin, value is (3.0) , and when I insert a value say "123.123456 " this number gets converted to 123.Code:$query = "CREATE TABLE P( code int(2) NOT NULL, value decimal(3.6) NOT NULL, PRIMARY KEY(code) ";
I just want to know how to represent a decimal in an sql statement for mysqlTags: None
Leave a comment: