Avatar
tờ ròm Tôi yêu Việt Nam

Hàm: create_table_with_column

Cách hoạt động của hàm này giống với hàm create_table, nhưng hàm này cho phép tạo bảng với nhiều cột/trường giá trị.

Cú pháp:
create_table_with_column(table_name, array_column)


Ví dụ:
{% set column_name = 'varchar(255) NOT NULL' %}
{% set column_time = 'int(11) NOT NULL' %}
{% set column_comment = 'text NOT NULL' %}

{% set structure = {'name':column_name,'time':column_time,'comment':column_comment} %}

{% do create_table_with_column('chat_demo', structure) %}
  • BBcode:
  • Markdown: