diff options
author | Derek Jones <derek.jones@ellislab.com> | 2011-08-31 21:18:48 +0200 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2011-08-31 21:18:48 +0200 |
commit | 47a62548cfdcd5fb6588a2caa92d3b55ac05de6f (patch) | |
tree | b1952e3cbfde4e1baf605526a573d112a4bc819d /system/database/drivers/mysql/mysql_result.php | |
parent | bbf2853c351425ea75f43599c3b229a8c323448c (diff) | |
parent | ef26dfcb705521be0ad85b00fdb735299bdd02d2 (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop
Diffstat (limited to 'system/database/drivers/mysql/mysql_result.php')
-rw-r--r-- | system/database/drivers/mysql/mysql_result.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/system/database/drivers/mysql/mysql_result.php b/system/database/drivers/mysql/mysql_result.php index 2d2905c98..6ceaf4b9b 100644 --- a/system/database/drivers/mysql/mysql_result.php +++ b/system/database/drivers/mysql/mysql_result.php @@ -86,10 +86,10 @@ class CI_DB_mysql_result extends CI_DB_result { $retval = array(); while ($field = mysql_fetch_object($this->result_id)) { - preg_match('/([a-zA-Z]+)\((\d+)\)/', $field->Type, $matches); + preg_match('/([a-zA-Z]+)(\((\d+)\))?/i', $field->Type, $matches); $type = $matches[1]; - $length = (int)$matches[2]; + $length = isset($matches[3]) ? (int) $matches[3] : NULL; $F = new stdClass(); $F->name = $field->Field; |