|
|
@@ -143,16 +143,7 @@ function dig_next($hist_loop,$prev_tbl,$prev_dig,$loop) {
|
|
|
if( isset($prev_dig->$prev_tbl['rel'][$x_rel_from]) and strlen($prev_dig->$prev_tbl['rel'][$x_rel_from]) > 1 ) { //
|
|
|
$sql_X[$X]['rel'][$x_rel_to]= $prev_dig->$prev_tbl['rel'][$x_rel_from];
|
|
|
}
|
|
|
- $sql_X['test'][]='1';
|
|
|
- }
|
|
|
- /*foreach($prev_dig as $col=>$val) {
|
|
|
- //transl ref to ref
|
|
|
- if( $prev_tbl['rel'][$z_rel_from] ) {
|
|
|
- $sql[$Z]['rel'][$z_rel_to]=$val;
|
|
|
- }
|
|
|
- }
|
|
|
- */
|
|
|
-
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -160,6 +151,24 @@ function dig_next($hist_loop,$prev_tbl,$prev_dig,$loop) {
|
|
|
echo "\n<br>sql_X<pre>";
|
|
|
print_r($sql_X);
|
|
|
echo "</pre>";
|
|
|
+
|
|
|
+ foreach($sql_X as $T => $rel) {
|
|
|
+ $sql_x[$T]=" select * from ".$T." where ( ";
|
|
|
+ foreach($rel['rel'] as $col=>$val) {
|
|
|
+ if( isset($sql_x_str[$T])) $sql_x_str[$T].=" or `".$col."` = '".$val."' " ;
|
|
|
+ else $sql_x_str[$T]=" `".$col."` = '".$val."' " ;
|
|
|
+ }
|
|
|
+ $sql_x[$T].=$sql_x_str[$T]." ) ";
|
|
|
+ //not loop
|
|
|
+ if( isset($hist_loop[$T])) {
|
|
|
+ foreach($hist_loop[$T] as $hist_rec) {
|
|
|
+ $sql_t[$T].=" and ID!='".$hist_rec->ID."' ";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ echo "<br> sql_x" ;
|
|
|
+ print_r($sql_x);
|
|
|
+
|
|
|
//X test eof
|
|
|
|
|
|
|