I am modifying a WebApp created on Wampserver. I want to add some options like a dropdown list named 'District' on the page CustomerData/Create.
After adding the code on fields.yaml :
district:
label: 'District'
options:
Ab: Aberdeen
Ad: Admiralty
Ap: Ap Lei Chau
Ca: Causeway Bay
Ce: Central
H: Happy Valley
K: Kowloon
M: Mid Levels
N: North Point
Pe: Peak
Po: Pok Fu Lam
Q: Quarry Bay
Sa: Sai Ying Pun
Sh: Sheung Wan
Ta: Taikoo Shing
Ti: Tin Hau
Wa: Wan Chai
Wo: Wong Chuk Hang
NT: NT
span: left
required: 1
type: dropdown
tab: 'Contact Information'
On MySQL Workbench, I added 'District'as ENUM('Kowloon','Central','North Point','Quarry Bay','Taikoo Shing','Tin Hau','Wan Chai','Happy Valley','Sai Ying Pun','Mid Levels','Sheung wan','Pok Fu Lam','Admiralty','Kennedy Town','Ap Lei Chau','Peak','Wong Chuk Hang','NT','Causeway Bay').
Nevertheless, I have the following error :
SQLSTATE[010000]:Warning:125 Data Truncated for column 'District' at row 1 (SQL: insert into ..... on line 664 of C:\wamp64...\Database\Connection.php)
Here is the code of Connection.php at line 664 :
protected function runQueryCallback($query, $bindings, Closure $callback)
{
// To execute the statement, we'll simply call the callback, which will actually
// run the SQL against the PDO connection. Then we can calculate the time it
// took to execute and log the query SQL, bindings and time in our memory.
try {
$result = $callback($query, $bindings);
}
// If an exception occurs when attempting to run a query, we'll format the error
// message to include the bindings with SQL, which will make this exception a
// lot more helpful to the developer instead of just the database's errors.
catch (Exception $e) {
throw new QueryException(
$query, $this->prepareBindings($bindings), $e
);
}
return $result;
}
How to fix this error?