|
@@ -90,14 +90,28 @@ function start_dig($tables) {
|
|
|
$sql='select * from '.$Y ;
|
|
$sql='select * from '.$Y ;
|
|
|
$res=$db->query($sql);
|
|
$res=$db->query($sql);
|
|
|
while($h=$db->fetch($res)) {
|
|
while($h=$db->fetch($res)) {
|
|
|
- print_r($h);
|
|
|
|
|
|
|
+ $hist_loop[$Y][]=$h;
|
|
|
|
|
+ dig_next($hist_loop,$h);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
function dig_next($hist_loop,$prev_dig) {
|
|
function dig_next($hist_loop,$prev_dig) {
|
|
|
-
|
|
|
|
|
|
|
+ global $db,$tables;
|
|
|
|
|
+ //detect next ref tbls
|
|
|
|
|
+ $sql = array();
|
|
|
|
|
+ foreach($tables['Z'] as $Z=>$z) {
|
|
|
|
|
+
|
|
|
|
|
+ foreach($prev_dig as $col=>$val) {
|
|
|
|
|
+ if($z['rel'] == $col) {
|
|
|
|
|
+ $sql[$Z]['rel'][$col]=$val;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ print_r($sql);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|