diff --git a/lib/Cake/Model/Datasource/Database/Mysql.php b/lib/Cake/Model/Datasource/Database/Mysql.php index a839fd059..568e06c82 100644 --- a/lib/Cake/Model/Datasource/Database/Mysql.php +++ b/lib/Cake/Model/Datasource/Database/Mysql.php @@ -309,7 +309,7 @@ class Mysql extends DboSource { throw new CakeException(__d('cake_dev', 'Could not describe table for %s', $table)); } - foreach ($cols as $column) { + while ($column = $cols->fetch(PDO::FETCH_OBJ)) { $fields[$column->Field] = array( 'type' => $this->column($column->Type), 'null' => ($column->Null === 'YES' ? true : false),