Diverses corrections
This commit is contained in:
parent
42c7be5e22
commit
9c860a1f1f
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class Table_MinMaxs extends Libs_Table
|
||||
class Table_Minmaxs extends Libs_Table
|
||||
{
|
||||
protected $_name = 'minmax';
|
||||
}
|
@ -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é');
|
||||
|
@ -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
|
||||
);
|
Loading…
Reference in New Issue
Block a user