Description:
I have a time field in MYSQL and I can import it to Excel but when I try to save it back with anything than a NULL/blank value it gives me an error.
The error that I'm getting is:
MySQL Error 1064:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':30:00 WHERE `id`=1497 AND `memberID`='0834' AND (('0834-15-0009' IS NULL AND `a' at line 1
How to repeat:
The MYSQL Database I'm using is:
I just follow the wizard to connect to the database and import the data. I then try to edit any of the data and save it back, it doesn't have to be in the time field and it just gives me the error.
This is the database and a standard kind of row.
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 13, 2017 at 08:31 AM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `fafa1424_records`
--
-- --------------------------------------------------------
--
-- Table structure for table `newrecords`
--
CREATE TABLE `newrecords` (
`id` int(11) NOT NULL,
`memberID` varchar(4) NOT NULL,
`animalID` varchar(25) DEFAULT NULL,
`nickName` varchar(50) NOT NULL,
`animal` varchar(256) NOT NULL,
`family` varchar(150) DEFAULT NULL,
`code` varchar(10) DEFAULT NULL,
`dateOfEncounter` date DEFAULT '1970-01-01',
`encounterAddress` varchar(256) DEFAULT NULL,
`postcode` varchar(256) DEFAULT NULL,
`LGA` varchar(256) DEFAULT NULL,
`encounterType` varchar(100) DEFAULT NULL,
`animalCondition` varchar(256) DEFAULT NULL,
`comment` mediumtext,
`animalSex` varchar(30) DEFAULT NULL,
`age` varchar(50) DEFAULT NULL,
`initalWeight` varchar(20) DEFAULT NULL,
`pouchCondition` varchar(256) DEFAULT NULL,
`initialAssessor` varchar(256) DEFAULT NULL,
`rehabilitatorName` varchar(256) DEFAULT NULL,
`fateOfAnimal` varchar(256) DEFAULT NULL,
`memberHolding` varchar(256) DEFAULT NULL,
`dateOfFate` date DEFAULT '1970-01-01',
`releaseLocation` varchar(256) DEFAULT NULL,
`releasePostcode` varchar(256) DEFAULT NULL,
`releaseGPS` varchar(50) DEFAULT NULL,
`chipNumber` varchar(256) DEFAULT NULL,
`rehabilitator1` varchar(256) DEFAULT NULL,
`rehabilitator2` varchar(256) DEFAULT NULL,
`rehabilitator3` varchar(256) DEFAULT NULL,
`rehabilitator4` varchar(256) DEFAULT NULL,
`date_transfer1` date DEFAULT '0000-00-00',
`date_transfer2` date DEFAULT '0000-00-00',
`date_transfer3` date DEFAULT '0000-00-00',
`date_transfer4` date DEFAULT '0000-00-00',
`timeOfCall` time DEFAULT NULL,
`callerDetails` varchar(256) DEFAULT NULL,
`contactNumber` varchar(20) DEFAULT NULL,
`incidentDetails` varchar(1024) DEFAULT NULL,
`memberContacted` varchar(256) DEFAULT NULL,
`actionTaken` varchar(256) DEFAULT NULL,
`finalised` varchar(5) DEFAULT NULL,
`recordFinalised` int(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `newrecords`
--
INSERT INTO `newrecords` (`id`, `memberID`, `animalID`, `nickName`, `animal`, `family`, `code`, `dateOfEncounter`, `encounterAddress`, `postcode`, `LGA`, `encounterType`, `animalCondition`, `comment`, `animalSex`, `age`, `initalWeight`, `pouchCondition`, `initialAssessor`, `rehabilitatorName`, `fateOfAnimal`, `memberHolding`, `dateOfFate`, `releaseLocation`, `releasePostcode`, `releaseGPS`, `chipNumber`, `rehabilitator1`, `rehabilitator2`, `rehabilitator3`, `rehabilitator4`, `date_transfer1`, `date_transfer2`, `date_transfer3`, `date_transfer4`, `timeOfCall`, `callerDetails`, `contactNumber`, `incidentDetails`, `memberContacted`, `actionTaken`, `finalised`, `recordFinalised`) VALUES
(721, '0335', '0335-15-0003', 'Smokey', 'Frogmouth, Tawny', 'BN', '313', '2015-09-16', 'South West Rocks Road, ', '2440 - POLA CREEK', 'Kempsey Shire Council', 'Collision - Motor Vehicle', 'Injury to body', 'Found on the road at night, possibly hit by car.16', 'Unknown', 'Unknown', 'unkown', 'N/A', '0335 - Yvonne', '0335 - Yvonne', '', '0335 - Yvonne', NULL, '', '', '', '', '', '', '', '', '1970-01-01', '1970-01-01', '1970-01-01', '1970-01-01', '05:12:12', '', '', '', '', '', '', 0);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `newrecords`
--
ALTER TABLE `newrecords`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `animalid` (`animalID`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `newrecords`
--
ALTER TABLE `newrecords`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13709;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
--------------------------------------------------------------------------
The SQL statement that is being applied is
UPDATE `fafa1424_records`.`newrecords` SET `timeOfCall`=03:30:00 WHERE `id`=1497 AND `memberID`='0834' AND (('0834-15-0009' IS NULL AND `animalID` IS NULL) OR `animalID`='0834-15-0009') AND `nickName`='Fideous' AND `animal`='Wallaby, Red-necked' AND (('M' IS NULL AND `family` IS NULL) OR `family`='M') AND (('1261' IS NULL AND `code` IS NULL) OR `code`='1261') AND (('2015-06-14' IS NULL AND `dateOfEncounter` IS NULL) OR `dateOfEncounter`='2015-06-14') AND (('Armidale road, 16' IS NULL AND `encounterAddress` IS NULL) OR `encounterAddress`='Armidale road, 16') AND (('2440 - WILLAWARRIN' IS NULL AND `postcode` IS NULL) OR `postcode`='2440 - WILLAWARRIN') AND (('Kempsey Shire Council' IS NULL AND `LGA` IS NULL) OR `LGA`='Kempsey Shire Council') AND (('Collision - Motor Vehicle' IS NULL AND `encounterType` IS NULL) OR `encounterType`='Collision - Motor Vehicle') AND (('No apparent distress' IS NULL AND `animalCondition` IS NULL) OR `animalCondition`='No apparent distress') AND (('' IS NULL AND `comment` IS NULL) OR `comment`='') AND (('Male' IS NULL AND `animalSex` IS NULL) OR `animalSex`='Male') AND (('Juvenile' IS NULL AND `age` IS NULL) OR `age`='Juvenile') AND (('697g' IS NULL AND `initalWeight` IS NULL) OR `initalWeight`='697g') AND (('N/A' IS NULL AND `pouchCondition` IS NULL) OR `pouchCondition`='N/A') AND (('Dianne Gorham' IS NULL AND `initialAssessor` IS NULL) OR `initialAssessor`='Dianne Gorham') AND (('0834 - Betty Booth' IS NULL AND `rehabilitatorName` IS NULL) OR `rehabilitatorName`='0834 - Betty Booth') AND (('Escaped From Care' IS NULL AND `fateOfAnimal` IS NULL) OR `fateOfAnimal`='Escaped From Care') AND (('' IS NULL AND `memberHolding` IS NULL) OR `memberHolding`='') AND (('2015-11-14' IS NULL AND `dateOfFate` IS NULL) OR `dateOfFate`='2015-11-14') AND (('' IS NULL AND `releaseLocation` IS NULL) OR `releaseLocation`='') AND (('' IS NULL AND `releasePostcode` IS NULL) OR `releasePostcode`='') AND (('' IS NULL AND `releaseGPS` IS NULL) OR `releaseGPS`='') AND (('' IS NULL AND `chipNumber` IS NULL) OR `chipNumber`='') AND (('0108 - Joy Mackay' IS NULL AND `rehabilitator1` IS NULL) OR `rehabilitator1`='0108 - Joy Mackay') AND (('1566 - Noeline Patterson' IS NULL AND `rehabilitator2` IS NULL) OR `rehabilitator2`='1566 - Noeline Patterson') AND (('0901 - Diane Gorham' IS NULL AND `rehabilitator3` IS NULL) OR `rehabilitator3`='0901 - Diane Gorham') AND (('1577 - Narelle Anderson' IS NULL AND `rehabilitator4` IS NULL) OR `rehabilitator4`='1577 - Narelle Anderson') AND (('2015-06-15' IS NULL AND `date_transfer1` IS NULL) OR `date_transfer1`='2015-06-15') AND (('2015-07-16' IS NULL AND `date_transfer2` IS NULL) OR `date_transfer2`='2015-07-16') AND (('2015-10-09' IS NULL AND `date_transfer3` IS NULL) OR `date_transfer3`='2015-10-09') AND (('2015-11-02' IS NULL AND `date_transfer4` IS NULL) OR `date_transfer4`='2015-11-02') AND ((12:20:00 IS NULL AND `timeOfCall` IS NULL) OR `timeOfCall`=12:20:00) AND (('' IS NULL AND `callerDetails` IS NULL) OR `callerDetails`='') AND (('' IS NULL AND `contactNumber` IS NULL) OR `contactNumber`='') AND (('' IS NULL AND `incidentDetails` IS NULL) OR `incidentDetails`='') AND (('' IS NULL AND `memberContacted` IS NULL) OR `memberContacted`='') AND (('' IS NULL AND `actionTaken` IS NULL) OR `actionTaken`='') AND (('' IS NULL AND `finalised` IS NULL) OR `finalised`='') AND ((2 IS NULL AND `recordFinalised` IS NULL) OR `recordFinalised`=2);
Suggested fix:
Unknown, any help would be great