bowen Posted November 22, 2006 Posted November 22, 2006 hi all, could some1 please help? i am using the easypopulate which is an exellent addition and saves time, but with how our stock constantly changes i am after setting up a cron job to run the script automatically. i have the csv file uploading to the server automatically from our pc along with images but i want the script to drop the current database (all product and stock related fields etc) then to upload the new csv file from the server to the database. i know the following cron job works with my test uploads but obviously integrating this in the the OS codeing is beyond me!! <?php include ("includes/connect.php"); $drop='delete from stock'; if (@mysql_query($drop)) { echo '<P>stock table succesfully deleted!</p>'; }else{ exit ('<p>error deleting table: '.mysql_error().'</p>');} $import='LOAD DATA local INFILE "./import.csv" INTO TABLE stock FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY """" LINES TERMINATED BY "\r\n" ignore 1 lines'; if (@mysql_query($import)) { echo '<P>stock table succesfully loaded!</p>'; }else{ exit ('<p>error loading table: '.mysql_error().'</p>');} ?> can any1 please please help?? thanks in advance.
bowen Posted November 24, 2006 Author Posted November 24, 2006 can any1 help with this please? i am really stuck
Recommended Posts
Archived
This topic is now archived and is closed to further replies.