D
D
Denis99992015-11-26 03:17:40
PHP
Denis9999, 2015-11-26 03:17:40

How to create an ENUM column using sqlite in php?

The problem is that due to the type of the status field, an error occurs:

$query_table = sqlite_query($db, "CREATE TABLE  tbl_post (
  title char(200) ,
  content LONGTEXT ,
  status ENUM('1','2','3'),
  tags char(200)  );
");
  if (!$query_table) exit("Невозможно создать таблицу в базе данных!");

Error:
Warning: sqlite_query() [function.sqlite-query]: near "'1'": syntax error in K:\home\test1.ru\www\index2.php on line 23
How to insert ENUM field?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2015-11-26
@prototype_denis

www.sqlite.org/datatype3.html
1.0 Storage Classes and Datatypes
Each value stored in an SQLite database (or manipulated by the database engine) has one of the following storage classes:
It doesn't have that...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question