need 5000 insert lines ran on my db

Status
Not open for further replies.

rebelsforchrist

New Member
Messages
23
Reaction score
0
Points
0
sorry guys, but i've been trying this on my own for like an hour. i tried doing the file import, and when i tried using just the sql box, the form would timeout before all the lines executed.

i attached the file to this post; could an admin please run this for me on the rfc1_rfc database?
 
Last edited:

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
I don't see any attached files, and can't you just break it up into like 500 and run a few of them?
 

rebelsforchrist

New Member
Messages
23
Reaction score
0
Points
0
I don't see any attached files, and can't you just break it up into like 500 and run a few of them?

sorry, i had hit the first submit button instead of the 2nd one.
actually i tried that, hence the accumulation of like an hour of time wasted.
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
PHP:
<?php

   mysql_connect('hostname', 'username', 'password');
   mysql_select_db('databasename');

   $fileName = 'filename.txt';
   if (false === ($sqlContents = file_get_contents($fileName))) {
      die('Error opening file '. $fileName);
   }
   $lineArray = explode("\n", $sqlContents);
   foreach ($lineArray as $key => $lineValue) {
      mysql_query(trim($lineValue));
      usleep(1000);
   }

?>

Can you figure out how to use that?
 
Last edited:

rebelsforchrist

New Member
Messages
23
Reaction score
0
Points
0
thanks a lot, Bryon, that script worked nicely. thanks Brandon for your help too. i was able to get all the rows inserted with the php script.
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
Same error.

Edit: Whoops, I think I just cleared them from your database, you may have to re-enter them.
 
Last edited:

rebelsforchrist

New Member
Messages
23
Reaction score
0
Points
0
i was able to get it done with the script. thanks :) i tried to edit my other post, but i didn't see the edit button/link. so i will use this one to close this thread. thanks for the help.
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
Sorry about deleting them:eek:hnoes:

Let us know if you need any more support.
 
Status
Not open for further replies.
Top