Diverses corrections

This commit is contained in:
Michael RICOIS 2012-03-05 16:55:26 +00:00
parent 42c7be5e22
commit 9c860a1f1f
3 changed files with 8 additions and 9 deletions

View File

@ -1,5 +1,5 @@
<?php
class Table_MinMaxs extends Libs_Table
class Table_Minmaxs extends Libs_Table
{
protected $_name = 'minmax';
}

View File

@ -72,17 +72,16 @@ foreach($keys as $key) {
//Lecture
$sql = 'SELECT MIN('.$key.') AS min, MAX('.$key.') AS max FROM etablissements_act';
$dbMetier->setFetchMode(Zend_Db::FETCH_ASSOC);
$result = $dbMetier->fetchAll($sql);
$stmt = $dbMetier->query($sql);
$result = $stmt->fetchObject();
//Insertion
$data = array(
'cle' => $key,
'min' => $result['min'],
'max' => $result['max'],
'min' => $result->min,
'max' => $result->max,
);
$db->insert('minmax', $data);
if ($opts->manuel) print($key.'-> min:'.$result['min'].' max:'.$result['max']."\n");
if ($opts->manuel) echo $key.' -> min:'.$result->min.' max:'.$result->max."\n";
}
if ($opts->manuel) print('Terminé');

View File

@ -1,5 +1,5 @@
CREATE TABLE `minmax` (
`cle` INTEGER PRIMARY KEY NOT NULL,
`cle` VARCHAR(20) PRIMARY KEY NOT NULL,
`min` INTEGER NOT NULL,
`max` BIGINT NOT NULL
);