您的位置:首页 >> Web开发 >> CGI技术 >> 正文
CGI技术 RSS
 

尝试用sql查询语句操纵普通文本数据库!使用简单的select就可以实现文本的索引访问,用update……

http://www.rdxx.com 06年04月21日 07:27 网海之贝 我要投稿


        $element =~ s/\s+$//g;
        $return->{$keys->{$i}}=$element;
     }
     return $return;
}
#------------------------------------------------
sub readtxtfile
{
    my $just = $_[0].".lock";

    while(-f $just)
    {select(undef,undef,undef,0.1);}
    open(LOCKFILE,">$just");

    open(READTXTFILE,"$_[0]");
    my @readtxtfile=;
    close(READTXTFILE);

    close(LOCKFILE);
    unlink($just);

    return @readtxtfile;
}
#------------------------------------------------
sub writetxtfile
{
    my $just = $_[0].".lock";

    while(-f $just)
    {select(undef,undef,undef,0.1);}
    open(LOCKFILE,">$just");

    if ($_[2] == 1)
    {open (WRITETXTFILE,">$_[0]");}
    else{open (WRITETXTFILE,">>$_[0]");}
    print WRITETXTFILE $_[1];
    close(WRITETXTFILE);

    close(LOCKFILE);
    unlink($just);

    return(1);
}
#------------------------------------------------
sub notify
{
    use CGI;
    my $query = new CGI;
    print $query->header() if ($_[1] == 1);
    print $_[0];
    exit;
}
#------------------------------------------------

1;

__END__


=head1 NAME

JTDB -- A modules of control a txt-database width SQL-words

=head1 SYNOPSIS

    use lib "."; # If NT,use lib "path-to-jtdb_directory";
    use JTDB "1.01";

    $main::split = ","; # Notice!, It's necessary! must be $main::split,

共11页  第1页 第2页 第3页 第4页 第5页 第6页 第7页 第8页 第9页 第10页 第11页


 
 
标签: 文本数据 , 文本 , 索引访问 , 查询语句 , Update , Select , SQL , 数据 , 语句 , PD , 查询 , 索引 , 访问 打印本文
 
 
  相关资讯
RSS
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站