obyno Posted March 25, 2003 Share Posted March 25, 2003 trying to insert from three text files of 1000 tab delimited lines into db lets me go only as far as 255 rows and no further each time.And then of these a select query comes up blank via an html form page.Please what could be the prob.Anyone help? I need to have the insertions done like - have the first element of the phonenumber.txt file inserted under phonenumber column, then have the first element of the name.txt file go into the name column of db, then the address column go in after it;then have this repeated row row for the three files until all the data has been inserted.When I do it all in one insert statement nested in foreach statements i receivemultiples of each elment for...really hope you can help.Thanks for caring <? include \"db.php\"; $nu = @fopen(\"phonenumber.txt\", \"r\") or die(\"<br>Failed to open file: <i>phonenumber.txt</i>.\"); $array = file(\"phonenumber.txt\"); $nu = @fopen(\"userlist.txt\", \"r\") or die(\"<br>Failed to open file: <i>userlist.txt</i>.\"); $array1 = file(\"userlist.txt\"); $nu = @fopen(\"password.txt\", \"r\") or die(\"<br>Failed to open file: <i>password.txt</i>.\"); $array2 = file(\"password.txt\"); for ($i=0; $i<count($array); $i++) { $myquery = \"INSERT into totalled (phoneNumber, user, password) VALUEs (\'$array[$i]\', \'$array1[$i]\', \'$array2[$i]\')\"; $result = mysql_query($myquery, $ok); if (!$result) { echo \"Nothing\"; } } ?> Quote Link to comment Share on other sites More sharing options...
obyno Posted March 26, 2003 Author Share Posted March 26, 2003 Please somebody, please!!!! Quote Link to comment 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.