Hàm: insert_row_array_table()

By Khỉ đầu chó lông xoăn, 77448 View
Hàm này dùng để thêm hàng dữ liệu vào bảng.

Cú pháp:
insert_row_array_table(table_name, rows)

Trong đó:
- table_name (string): tên bảng
- rows (array): dữ liệu của hàng tương ứng với trường cho trước

Ví dụ:
{% set data_chatbox = {"name":"bot","messeage":"Chào mừng đến với SMM","time":"123"} %}
{{insert_row_array_table('chatbox', data_chatbox)}}


Ngoài ra, nếu chỉ muốn thêm hàng dữ liệu theo 1 trường duy nhất, ta sử dụng hàm insert_row_table(), đây là một hàm con của insert_row_array_table(), cú pháp như sau:
insert_row_table(table_name, column_name, column_value)