asongisabeautifullie Posted April 6, 2003 Share Posted April 6, 2003 As part of an administrator\'s page for a site I want to include an option to upload a text file for bulk loading into the database. I was thinking that I could do this with a form, where the POSTed file would have name=\"bulk\". The path to the uploaded file will then be $bulk. I would then run an sql query loading data from this file into the table. So far I\'ve failed miserably at making this happen, if anyone has any clever ideas please post your script suggestions. Cheers! Quote Link to comment https://forums.phpfreaks.com/topic/318-running-load-data-infile-with-php/ Share on other sites More sharing options...
effigy Posted April 7, 2003 Share Posted April 7, 2003 sounds like an ok idea. what part is the script failing on? Quote Link to comment https://forums.phpfreaks.com/topic/318-running-load-data-infile-with-php/#findComment-1020 Share on other sites More sharing options...
asongisabeautifullie Posted April 7, 2003 Author Share Posted April 7, 2003 The main problem with what I\'ve tried so far is that LOAD DATA INFILE will only open a file in the database\'s data folder in the mysql folder. I tested to see where the uploaded file goes, and it was something like C:PHPuploadtempphp8.tmp While I\'m doing this on my own local server I know I could use this code to move the file to the database directory: if (is_uploaded_file($bulk)) { move_uploaded_file($bulk, \"C:MySQLdatabooksbulk.txt\"); } But I can\'t do this on my web host cos I wouldn\'t have permission... Quote Link to comment https://forums.phpfreaks.com/topic/318-running-load-data-infile-with-php/#findComment-1024 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.