select(GesTable::qryCampos($table,$dbname),true); $key = GesTable::primaryKey($campos); $del = "DELETE FROM ".$table." WHERE "; $j=0; foreach ($campos as $c) { if ($key[$j]) { eval("\$valor = "."\$key_"."$c[Field];"); if ($valor=="") $del.= "$c[Field] IS Null AND "; else if (strpos($c["Type"],"int")!==false) $del.= "$c[Field] = ".$valor." AND "; else if (strpos($c["Type"],"decimal")!==false) $del.= "$c[Field] = ".$valor." AND "; else // las cadenas, fechas y horas van entre '' $del.= "$c[Field] = '".$valor."' AND "; } $j++; } $del = substr($del,0,strlen($del)-4); // quitar el ultimo AND //echo $del."
"; exit; $bd->execSql($del); $bd->cierraConexion(); $incremento = isset($increment)?"&increment=$increment":""; $orden = isset($order)?"&order=$order":""; $cabecera = isset($cabecera)?"&cabecera=$cabecera":""; $link = isset($link)?"&link=$link":""; header("Location: Table.php?table=$table&dbname=$dbname$orden$incremento$cabecera$link"); ?>