Correction fetch

This commit is contained in:
xdrm-brackets 2016-07-24 12:34:55 +02:00
parent ed16ab2cc5
commit 1a6900ce01
2 changed files with 14 additions and 14 deletions

View File

@ -702,14 +702,12 @@
$requestS = SQLBuilder::SELECT($selectTables)."\n";
/* [2] On rédige la clause FROM
========================================================*/
/* (1) Table locale */
$requestS .= SQLBuilder::FROM( array_keys($selectTables) )."\n";
/* [5] On rédige la clause WHERE/AND
=========================================================*/
/* (0) On initialise le conteneur des variables "bindés" */
@ -730,9 +728,11 @@
}
/* (2) On ajoute les jointures */
foreach($this->joined as $localField=>$rows)
foreach($this->joined as $localField=>$rows){
if( $c == 0 ) $requestS .= 'WHERE '.$this->schema['table'].'.'.$localField.' = '.$this->schema['columns'][$localField]['references'][0].'.'.$this->schema['columns'][$localField]['references'][1]."\n";
else $requestS .= 'AND '.$this->schema['table'].'.'.$localField.' = '.$this->schema['columns'][$localField]['references'][0].'.'.$this->schema['columns'][$localField]['references'][1]."\n";
$c++;
}
/* (3) On ajoute les conditions des jointures */
foreach($this->joined as $rows)

View File

@ -433,17 +433,17 @@
//
// ->delete();
//
// $module = Table::get('module')
// ->whereName([ $_SESSION['WAREHOUSE']['modules'], Rows::COND_IN ]);
//
// $chip = Table::get('chip')
// ->select('*');
//
// $module_merge = Table::get('module_merge')
// ->join('id_module', $module)
// ->join('id_chip', $chip);
//
// var_dump($module_merge->fetch());
$module = Table::get('module')
->whereName([ $_SESSION['WAREHOUSE']['modules'], Rows::COND_IN ]);
$chip = Table::get('chip')
->select('*');
$module_merge = Table::get('module_merge')
->join('id_module', $module);
// ->join('id_chip', $chip);
var_dump($module_merge->fetch());
?>