Re: uploading a file straight into a mySQL database

From: Date: Wed, 30 Aug 2000 01:21:16 +0000
Subject: Re: uploading a file straight into a mySQL database
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-14282@lists.php.net to get a copy of this message
On 29 Aug, Sam wrote: > Thanks for all your help so far, I have now cracked it up to a certain > point. > > How can I upload this new file (which is now db friendly) into a mysql db... > > I thought that this might be along the correct lines.. > > $fd = fopen ($filename, "r"); > while ($datainfo = fread ($fd, 1000000)){ > mysql_query("INSERT INTO all_trips values('$datainfo')") > or die("unable to insert"); > } > > > > but unfortunatly no.. > mySQL's LOAD DATA INFILE might be what you want. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#14282) next »