<?
$r=mysql_query("SELECT * FROM catalog WHERE id_catalog='".$catalog_iz."'");
$rr=mysql_fetch_array($r);

mysql_query("UPDATE catalog SET rayon_obyaz = '".$rr['rayon_obyaz']."', map = '".$rr['map']."', tab = '".$rr['tab']."', stolb = '".$rr['stolb']."', count_field = '".$rr['count_field']."' WHERE id_catalog='".$catalog_v."'");

mysql_query("DELETE FROM field WHERE id_catalog='".$catalog_v."'");

$r=mysql_query("SELECT * FROM field WHERE id_catalog='".$catalog_iz."'");
while($rr=mysql_fetch_array($r))
	{
	mysql_query("INSERT INTO field 
	(
	id_catalog,
	field_admin,
	field,
	field_no,
	field_tab,
	field_search,
	field_search_typ,
	field_form,
	field_error,
	field_spisok,
	field_sel_check,
	field_format,
	field_znak,
	field_d_1,
	field_d_2,
	field_intval_spis,
	field_typ,
	field_tp,
	field_num,
	field_field,
	field_field_two,
	field_param_search,
	field_zag,
	field_zag_pref,
	field_zag_suff,
	spec
	) 
	VALUES
	(
	'".$catalog_v."',
	'".$rr['field_admin']."',
	'".$rr['field']."',
	'".$rr['field_no']."',
	'".$rr['field_tab']."',
	'".$rr['field_search']."',
	'".$rr['field_search_typ']."',
	'".$rr['field_form']."',
	'".$rr['field_error']."',
	'".$rr['field_spisok']."',
	'".$rr['field_sel_check']."',
	'".$rr['field_format']."',
	'".$rr['field_znak']."',
	'".$rr['field_d_1']."',
	'".$rr['field_d_2']."',
	'".$rr['field_intval_spis']."',
	'".$rr['field_typ']."',
	'".$rr['field_tp']."',
	'".$rr['field_num']."',
	'".$rr['field_field']."',
	'".$rr['field_field_two']."',
	'".$rr['field_param_search']."',
	'".$rr['field_zag']."',
	'".$rr['field_zag_pref']."',
	'".$rr['field_zag_suff']."',
	'".$rr['spec']."'
	)");
	}
	
?>
