1 out of 7 values INSERT as a zero

I have the following code:

[php] $sql=“INSERT INTO Data (fileNum, depth, gr_edtc, cmff, cmrp_3ms, tcmr, ksdr, ktim) VALUES (1,’$row_data[1]’,’$row_data[2]’,’$row_data[3]’,‘row_data[4]’,’$row_data[5]’,’$row_data[6]’,’$row_data[7]’)”;
if (!mysqli_query($con,$sql)){die('Error: ’ . mysqli_error());} echo "record added ";[/php]

All values are doubles except for fileNum which is a double.

Table is as follows:

CREATE TABLE IF NOT EXISTS `Data` (`fileNum` int(11) NOT NULL,`depth` double NOT NULL,`gr_edtc` double NOT NULL,`cmff` double NOT NULL,`cmrp_3ms` double NOT NULL,`tcmr` double NOT NULL,'ksdr` double NOT NULL,`ktim` double NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

For some reason, row_data[4] which corresponds to cmrp_3ms is all zeros in the database. No other fields are inserted into the database with errors. When I echo out row_data[4] it outputs the correct values as if I were to echo any other values in the array. All values go out to 4 decimal places.

any ideas why only this one value is entered into the database as zero?

nvm, after posting this I quickly found my typo.

Sponsor our Newsletter | Privacy Policy | Terms of Service