ALTER TABLE tbl AUTO_INCREMENT = 123 how to request active records in the encoder?

How to perform

ALTER TABLE tblname AUTO_INCREMENT = 123

How to request an active record for codeigniter?

There is something in codeigniter called dbforge-> modify_column (), should I use this, if so, how?

+4
source share
2 answers

$this->db->query('ALTER TABLE tbl_name AUTO_INCREMENT 1'); works for me.

+2
source

try it

$this->db->query("ALTER TABLE table_name AUTO_INCREMENT 1");

change the value after where you want to start increasing the value automatically with this AUTO_INCREMENT

$this->db->query("ALTER TABLE table_name AUTO_INCREMENT 12");

Perform an operation on the DDL table The data definition language in which you execute queries in the database, not in the data.

+2
source

Source: https://habr.com/ru/post/1525557/


All Articles