writing text file contents into a recordset

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
noguru
Forum Commoner
Posts: 61
Joined: Thu Jun 06, 2002 4:03 am
Location: Just north of the City Of Gold, Land of Milk and Honey

writing text file contents into a recordset

Post by noguru »

How can I speed up the process of reading from text files? I use fopen to open the file and then loop through each line to check something using while(!feof). I use 2 very large text files and it takes forever to finally load my next page with the results. Is there a way (and how?) to create recordsets on the server and load the contents of the files into these? This way I might be able to filter a recordset by using a WHERE clause (for instance "SELECT * FROM rs2 WHERE ID=$row1['StudentNumber']"), instead of having to loop through each and every record.

Please help!
SuperHuman
Forum Newbie
Posts: 10
Joined: Wed Oct 16, 2002 10:00 pm

Post by SuperHuman »

Well, you are using a sluggish while loop to loop the data. Are you just searching for a string inside this file, or multiple strings or what are you searching for. Show some code so we can provide an efficient solution to your problem.....
Post Reply