Jump to content
xisto Community
Sign in to follow this  
iGuest

Loading values in txt file to database

Recommended Posts

I have a script that during the install, I am to run a file that is supposed to load zip code data into the database. It says it runs correctly at the end but yet the table in the database remains empty.

 

Here is the code:

 

PHP Code:

<?require('data.php');require('functions.php');sql_connect();$file=file("admin/zip.txt");$i=form_get("i");$start=$i+1;$end=$start+5000;if($end>=count($file)){$end=count($file);}for($i=$start;$i<$end;$i++){$sql_query=$file[$i];sql_execute($sql_query,'');if($i%5000==0){$link=$main_url."/load_zip_data.php?i=$i";show_screen($link);}}//forecho "DONE $start-$end";?>

Can anyone see anything wrong with this code to where it won't do what it should? The zip.txt is located in the admin directory as it should be. Thanks for any help! The file load_zip_data.php is the one that is the one that contains all script above.

:?: :?:

 

Added

 tags--CodeFX

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.