|
|
@@ -100,6 +100,7 @@ function start_dig($tables) {
|
|
|
function dig_next($hist_loop,$prev_tbl,$prev_dig,$loop) {
|
|
|
global $db,$tables;
|
|
|
$loop++;
|
|
|
+ echo "###LOOP ".$loop;
|
|
|
if($loop>5) die(' loop '.$loop);
|
|
|
//detect next ref tbls
|
|
|
$sql = array();
|
|
|
@@ -129,12 +130,15 @@ function dig_next($hist_loop,$prev_tbl,$prev_dig,$loop) {
|
|
|
$sql_t[$T].=" `".$col."` = '".$val." " ;
|
|
|
}
|
|
|
//not loop
|
|
|
- foreach($hist_loop[$T] as $hist_rec) {
|
|
|
- $sql_t[$T].=" and ID!='".$hist_rec->ID."' ";
|
|
|
+ if( isset($hist_loop[$T])) {
|
|
|
+ foreach($hist_loop[$T] as $hist_rec) {
|
|
|
+ $sql_t[$T].=" and ID!='".$hist_rec->ID."' ";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ echo "sql";
|
|
|
print_r($sql);
|
|
|
+ echo "sql_t";
|
|
|
print_r($sql_t);
|
|
|
|
|
|
foreach($sql_t as $T => $sql_ext) {
|
|
|
@@ -145,6 +149,7 @@ function dig_next($hist_loop,$prev_tbl,$prev_dig,$loop) {
|
|
|
}
|
|
|
}
|
|
|
//todo look in Y and die()
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|