Update to CodeIgniter 2.1.0
This commit is contained in:
17
system/database/drivers/mysql/mysql_result.php
Executable file → Normal file
17
system/database/drivers/mysql/mysql_result.php
Executable file → Normal file
@@ -84,14 +84,19 @@ class CI_DB_mysql_result extends CI_DB_result {
|
||||
function field_data()
|
||||
{
|
||||
$retval = array();
|
||||
while ($field = mysql_fetch_field($this->result_id))
|
||||
while ($field = mysql_fetch_object($this->result_id))
|
||||
{
|
||||
preg_match('/([a-zA-Z]+)(\(\d+\))?/', $field->Type, $matches);
|
||||
|
||||
$type = (array_key_exists(1, $matches)) ? $matches[1] : NULL;
|
||||
$length = (array_key_exists(2, $matches)) ? preg_replace('/[^\d]/', '', $matches[2]) : NULL;
|
||||
|
||||
$F = new stdClass();
|
||||
$F->name = $field->name;
|
||||
$F->type = $field->type;
|
||||
$F->default = $field->def;
|
||||
$F->max_length = $field->max_length;
|
||||
$F->primary_key = $field->primary_key;
|
||||
$F->name = $field->Field;
|
||||
$F->type = $type;
|
||||
$F->default = $field->Default;
|
||||
$F->max_length = $length;
|
||||
$F->primary_key = ( $field->Key == 'PRI' ? 1 : 0 );
|
||||
|
||||
$retval[] = $F;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user