X-Git-Url: https://git.jankratochvil.net/?p=www.energie.vellum.cz.git;a=blobdiff_plain;f=obsah_init.pl;h=1f7be3374d533d041bd5b0b3e6db8702d9c4c8a8;hp=d2ded01a73b2a35aa3b31207b31102c6c715abe9;hb=5184524480f39a76f89f6de59c4a5f21c778ae33;hpb=9d92d5cb57115acbb6189fad1e99847123900fc6 diff --git a/obsah_init.pl b/obsah_init.pl index d2ded01..1f7be33 100755 --- a/obsah_init.pl +++ b/obsah_init.pl @@ -37,7 +37,7 @@ eval { &db_do("drop table $tb_obsah") }; ."month tinyint not null," ."month_last tinyint not null," ."sequential smallint not null," - ."contents text not null" + ."contents text null" .")"); &db_do("alter table $tb_obsah add unique (year,month)"); @@ -66,7 +66,8 @@ sub flush_month $_=$contents; return if !defined $_; if (!$_) { - print("Empty contents".&where()."!\n"); + # Permitted to show just the title image + #print("Empty contents".&where()."!\n"); } else { tr/ \t\n/ \n/s; @@ -76,7 +77,7 @@ sub flush_month tr/\002//d; $_=substr($_,1); } - $insert_tb_obsah->execute($year,$month,$month_last,$sequential,$_) or die "SQL insert failure: $!"; + $insert_tb_obsah->execute($year,$month,$month_last,$sequential,($_ || undef())) or die "SQL insert failure: $!"; undef $year,$month; undef $contents; undef $first;