I would like to know how can I insert an 'enum' type in a mysqli query. I mean, if the field type is string and I execute a query like this:
INSERT INTO 'table'(field1,field2) VALUES ('?,?');
$stmt->bind_param('ss',$value1,$value2);
$stmt->execute();`
Everything is ok, but if I change 'field2' to enum type :
CREATE TABLE IF NOT EXISTS table (
field1 varchar(20) NOT NULL,
field2 ENUM('Administrator', 'User', 'Guest'
);
Then this query inserts the first field but the second one is empty. I have checked that the second field value is one of the ENUM type defined.
Thank you.