mysql - SQL Syntax Error in PHP code - adding together two values -
i keep getting syntax error in mysql code within php file. i'm trying increment/add value in table time variable. if me out i'd appreciate it.
php:
$sql = "update aircraft set maintenanceflighttime = (maintenanceflighttime + $maintenanceduration), aircraftid = $aircraftid";
error:
update aircraft set maintenanceflighttime = (maintenanceflighttime + 00:10:00), aircraftid = 8 have error in sql syntax; check manual corresponds mariadb server version right syntax use near ':10:00), aircraftid = 8' @ line 2
you cannot add string '01:01:01' time column can use addtime()
$maintenanceduration = '00:10:00'; $sql = "update aircraft set maintenanceflighttime = addtime(maintenanceflighttime, '$maintenanceduration') aircraftid = $aircraftid";
Comments
Post a Comment