I would like to get the size of decimal position set for a column with decimal type.
I have this value
decimal(10,3)
That is the content_type
. I got this by querying the content type of that particular column in information_schema.columns
Query I used is
$query="SELECT column_name as 'Column Name',
data_type as 'Data Type',
column_type as 'Column Type',
character_maximum_length as 'Max Length',
is_nullable as 'Nullable'
FROM information_schema.columns
WHERE table_name = '".$table_name."'";
And the query is working fine and I got the value decimal(10,3)
on $type
with this code.
$type = $row['Column Type'];
Now what I need to know is, how i can get 3(that is the decimal positions) from this result.
I need this value to figure out the value to be set for the step
attribute for html5 input
element