Re: insert *.TAB into table
| From: | Vadee Prudon | Date: | Wed, 02 Aug 2000 09:24:52 +0000 |
| Subject: | Re: insert *.TAB into table | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-9656@lists.php.net to get a copy of this message | ||
Hai,
I've tried a few suggestions and nothing seems to work.
On my server I set the CHMOD to R-W-E but still doesn't work
In my form I put ;
<FORM ENCTYPE="multipart/form-data" ACTION="submit.php3"
METHOD="GET">
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000000">
<P><INPUT TYPE="file" NAME="userfile"></P>
<P><INPUT TYPE="submit" value="submit"></P>
</FORM>
And in my submit.php3 I put ;
if ( ! ( $fd = fopen ( $userfile, "r" ) ) ) die ( "CAN'T FOPEN!" );
while (!feof($fd)) {
$buffer = fgets($fd, 4096);
echo $buffer;
When I use the method="POST" I get the error ;
Warning: fopen("","r") - No such file or directory in /www/test/submit.php3
on line 8 CAN'T FOPEN!
And when I use the method="GET" I get the error ;
Warning: fopen("C:\test\test.tab","r") - No such file or directory in
/www/test/submit.php3 on line 8 CAN'T FOPEN!
Can somebody help me ?,
Greetings Vadee
"Boget, Chris" <Chris.Boget@wild.net> schreef in berichtnieuws
637C00F0303AD311BCCC009027887A7C420DEC@tiger.wild.net...
> > I got the next problem, I'm exporting an *.TAB file out of my
> > database. When I have an empty field in my database he will
> > put an double tab. But when i'm importing this tab file into
> > MySQL database he doesn't see the double tab and all my data
> > is messed up. Is there a way to let my php recognize an double
> > tab as an empty data field ?
>
> First, how are you importing the data into the DB? Are you
> parsing each line as a record? Are you using mySQL's "LOAD
> DATA INFILE" functionality?
> If you are running though each line yourself and pulling each
> field from each record, one thing you can do prior to this is
> do an ereg_replace() on double tabs (\t\t) and convert them
> to a "tab space tab" so when you come across a space, you know
> it is an empty field.
>
> Chris
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>