How to insert decimal values into a SQL Table
This script is about inserting decimal data values into a SQL database.
The bold row is the key for solve this problem.
CREATE TABLE fruits(
id CHAR(3) NOT NULL,
fruits_name VARCHAR(40) NOT NULL,
price DECIMAL(6,2) NULL ,
);
Inserting php script:
INSERT INTO fruits VALUES('T07',23.55,566);
6 = number of digits before the comma
2 = number of decimals (after the comma)