Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Favorites to Database

Status
Not open for further replies.

gre

Programmer
Feb 14, 2001
1
GB
hello i am taking Favorites from the user and want to put it to the database a know how to take the favorites whit ImportExportFavorites in JavaScript then it writhe a text file and a want to loop thru the file and put it in db

tanks
gre
 
I'm not sure what your question is. If it is how to loop through a file, you can do it like this, assuming it has a consistent format and each line has a carriage return.

... CFFILE code here Let's assume the variable is #thisFile#....

<CFSET LineCount = 0>
<CFLOOP INDEX=&quot;ii&quot; LIST=&quot;#thisFile#&quot; DELIMITERS=&quot;#chr(13)#&quot;>
<CFSET LineCount = LineCount + 1>
(#LineCount#) #ii#<BR>
</CFLOOP>

This will loop through your file line by line printing the current line number and the line followed by an HTML break tag.

i.e. (1) This is the first line.<BR>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top