I thought I was making a bit of progress but I've come up against a 
brick wall trying to do what appears to be the most simple thing.

A button pressed in the page to delete a selected record is stripped 
of its display name to become simply the rowid.

When I run the statement in the sqlite command line the row is 
deleted but I get no result and no deletion from running the routine 
below either independently or in the html page.  I've tried with 
single quotes, double quotes and various other
Can someone please tell me what I'm doing wrong?


#!/usr/local/bin/perl
use strict;
use DBI qw(:sql_types);
my $database = "/Library/webserver/data/iceman.iceman";
my $dbh = DBI->connect("dbi:SQLite:dbname=$database","","", { 
RaiseError => 1, AutoCommit => 1 }) ||
print "<p>Cannot connect: $DBI::errstr</p>\n";

my %q;
$q{BUTTON} = "Delete c10";
$q{BUTTON} =~ s~^Delete[^\d]+~~i;
if ($q{BUTTON} =~ s~^Delete[^\d]+~~i){
        my $rows = $dbh->do("DELETE FROM contacts WHERE rowid =$q{BUTTON}");
        print $rows;
}
$dbh->disconnect;

# JD
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to