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:
Ví dụ:
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) %}