|
|
@@ -155,9 +155,11 @@ function dig_next($hist_loop,$prev_tbl,$prev_dig,$loop) {
|
|
|
foreach($z_rel_and_arr as $z_rel_and_name=>$z_rel_and_name_col) {
|
|
|
//echo "<br>156 z_rel_and_name=".$z_rel_and_name." ";
|
|
|
$sql_rel_and_sql[$T][$z_rel_and_name]="select * from ".$T." where ( ";
|
|
|
+ $and=0;
|
|
|
foreach($z_rel_and_name_col as $z_rel_and_name_cur=>$z_rel_and_name_col_to) {
|
|
|
- if( isset($sql_rel_and_sql[$T][$z_rel_and_name])) $sql_rel_and_sql[$T][$z_rel_and_name].=" and `".$z_rel_and_name_cur."` like '%.".$z_rel_and_name_col_to."%'" ;
|
|
|
+ if( $and==1) $sql_rel_and_sql[$T][$z_rel_and_name].=" and `".$z_rel_and_name_cur."` like '%.".$z_rel_and_name_col_to."%'" ;
|
|
|
else $sql_rel_and_sql[$T][$z_rel_and_name]=" `".$z_rel_and_name_cur."` like '%.".$z_rel_and_name_col_to."%'" ;
|
|
|
+ $and=1;
|
|
|
}
|
|
|
if( isset($hist_loop[$T])) {
|
|
|
foreach($hist_loop[$T] as $hist_rec) {
|