MyExcelShhet

ERROR: Can't insert Date on my phpmyadmin database.

Catchable fatal error: Object of class DateTime could not be converted to string

Im trying to Import an excel file on my database using php myqli code. Almost everything was perfect but error occured saying "Catchable fatal error: Object of class DateTime could not be converted to string"

BTW. the type of my rqn_date was 'Date' not varchar. I'd like to import the date but it seems i cant do it. I think Something is Missing.

 $daten = $row[0];
 $no1 = $row[1];
 $no2 = $row[2];
 $no3 = $row[3];
 $no4 = $row[4];
 $no5 = $row[5];          

 //Here, You can insert data into database.
 $qry = "INSERT INTO `rqn_list`(`rqn_list_date`, `rqn_no`, `rqn_dsc`,  `rqn_list_cc`, `rqn_list_wf`, `rqn_list_remarks`) VALUES ('$daten', '$no1', '$no2', '$no3', '$no4', '$no5')";
 $res = mysqli_query($con,$qry);

0 Answers