i writing script check if client's database date according master database, the
$this -> db-> field_data($a_table)
function not return field details.
i need details auto increment (under in phpmyadmin), assigned zerofill (under attributes) , other information auto_increment starts
i not find other way of getting these info, if not possible, fine, great if knows how these.
thanx in advance
use below way
$this->db->list_fields('table')
or
$fields = $this->db->field_data('table-name'); foreach ($fields $field) { echo $field->name; // name echo $field->type; // type echo $field->max_length; // maxlength echo $field->primary_key; // primary key }
and autoincrement
$next = $this->db->query("show table status 'table-name'"); $next = $next->row(0); $next->auto_increment; echo $next->auto_increment;
Comments
Post a Comment