Export.pl
上传用户:qdrechuli
上传日期:2022-08-01
资源大小:917k
文件大小:1k
- #!/usr/bin/perl -w
- use strict;
- use DBI;
- use CGI;
-
- sub main
- {
-
-
- my $CamID = 1;
- my $Date = "2002093008";
-
- my $db = DBI->connect("DBI:mysql:netcam","root","");
- my $sqlreq = "SELECT R_Img,R_Index FROM record WHERE ";
- $sqlreq .= "R_Cam=".$CamID." ";
- $sqlreq .= "AND R_Date like '".$Date."%' ";
- my $sql = $db->prepare($sqlreq);
- $sql->execute();
- while ((my $Img,my $Index) = $sql->fetchrow())
- {
- open(FILE,">".$Date."_".$Index.".jpg");
- print FILE $Img;
- close(FILE);
- print length($Img),"n";
- }
- $sql->finish();
- $db->disconnect();
-
- }
-
- main();
- exit(0);