Re: [phpodpworld-users] Phpodpworld.pl temp file not found
Status: Beta
Brought to you by:
hansfn
|
From: Nicholas J. <joh...@ne...> - 2007-07-05 19:34:29
|
Thanks Howard, I've added those lines and will attempt it again overnight.
For the time being I imported the temp files into mysql directly.
I now have an issue where, after counting the categories, the index.php page
does not display anything - just a white page. The maintinence page
displays fine. Any known or obvious issues there?
Nick
-----Original Message-----
From: Howard Lee [mailto:hl...@gm...]
Sent: 05 July 2007 06:52
To: Nicholas Johnston
Cc: php...@li...
Subject: Re: [phpodpworld-users] Phpodpworld.pl temp file not found
On 7/4/07, Nicholas Johnston <joh...@ne...> wrote:
> Hello all,
>
> Using phpodpworld.pl to import structure or content in the database,
> all records are successfully loaded, but then followed by the error below:
>
> DBD::mysql::db do failed: File 'C:WINDOWSTEMP1NfxkiP8CnW' not found
> (Errcode: 2) at C:\\mypath\phpodpworld.pl line 576.
>
> The temp file is created successfully in the correct directory, but
> then cannot be found successfully. I can only think that the path
> shown, C:WINDOWSTEMP1NfxkiP8CnW, is not successful because it doesn't
> contain the slashes required...
I use it on Linux and MySQL and this problem does not occur.
Apparently MySQL requires double backslashes for paths in LOAD DATA
statement on Windows.
For testing purpose, I would suggest to change the below statements and see
if it works or not. There might be a better way to do it though.
From:
$dbh->do("LOAD DATA LOCAL INFILE '$tempname' INTO TABLE xurls FIELDS
OPTIONALLY ENCLOSED BY \"'\"");
To:
my $tempname_mysql = $tempname;
$tempname_mysql =~ s/\\/\\\\/g;
$dbh->do("LOAD DATA LOCAL INFILE '$tempname_mysql' INTO TABLE xurls FIELDS
OPTIONALLY ENCLOSED BY \"'\"");
From:
$dbh->do("LOAD DATA LOCAL INFILE '$temp_res' INTO TABLE resources FIELDS
OPTIONALLY ENCLOSED BY \"'\""); $dbh->do("LOAD DATA LOCAL INFILE '$temp_str'
INTO TABLE structure FIELDS OPTIONALLY ENCLOSED BY \"'\"");
To:
my $temp_res_mysql = $temp_res;
my $temp_str_mysql = $temp_str;
$temp_res_mysql =~ s/\\/\\\\/g;
$temp_str_mysql =~ s/\\/\\\\/g;
$dbh->do("LOAD DATA LOCAL INFILE '$temp_res_mysql' INTO TABLE resources
FIELDS OPTIONALLY ENCLOSED BY \"'\""); $dbh->do("LOAD DATA LOCAL INFILE
'$temp_str_mysql' INTO TABLE structure FIELDS OPTIONALLY ENCLOSED BY
\"'\"");
Howard
|