chiark / gitweb /
wip
[nj-awaymsg.git] / mason / save
index 1f813c4867d969858902737870bbccb0f0648ed0..cedd05b28e87d389583cddfccb492fa5a520f343 100755 (executable)
@@ -1,5 +1,6 @@
 <%init>
 use AwayMsg;
+use Data::Dumper;
 db_connect();
 www_begin($r,$m);
 </%init><%args>
@@ -27,7 +28,7 @@ if ($textid ne 'new') {
 }
 
 if ($textid eq 'new') {
-    my $textid = time;
+    $textid = time;
     my $ntextq = $dbh->prepare("SELECT textid FROM texts".
                               " ORDER BY textid DESC LIMIT 1");
     $ntextq->execute();
@@ -38,6 +39,8 @@ if ($textid eq 'new') {
     }
 }
 
+print STDERR Dumper([$textid, $desc, $subject, $text]);
+
 my $dinsertq = $dbh->prepare("INSERT INTO texts (textid, desc, subject, text)".
                             " VALUES (?,?,?,?)");
 $dinsertq->execute($textid, $desc, $subject, $text);
@@ -51,7 +54,7 @@ my $tlistq = $dbh->prepare("SELECT * FROM config");
 $tlistq->execute();
 while (my $row = $tlistq->fetchrow_hashref()) {
     if ($ARGS{"u_".hquote($row->{'emailaddr'})}) {
-fixme
+       $tinsertq->execute($row->{'emailaddr'}, $textid);
     }
 }