Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

Comma Delimiting

Posted 11 Jan 2005 13:50:12
1
has voted
11 Jan 2005 13:50:12 Matt Jukes posted:
Hello and thanks for any Help in advance

I have a Textarea that has several items input to it. I separate these items with a Comma, However my code inputs a Comma after every Entry. e.g. Item01, Item02, Item03,
When i update My Mysql Database with this string at present, after spliting it Using SPLIT functionality, My code adds a Further blank entry to the database. I would like to know how to stop writing in the last Comma to the Textarea. My code for the Textarea is Below.

<textarea name="field" id="field" class="class" rows="5" cols="45"><%
strSQL = "SELECT * FROM table"
Set rset = objADODB.Execute(strSQL)
Do Until rset .EOF %>
<%=rset ("name"%>
<%=(", "%>
<% rset .MoveNext: Loop %>
</textarea>

Any Ideas or pointers would be great.
Thanks
Matt

Replies

Replied 11 Jan 2005 22:09:06
11 Jan 2005 22:09:06 Chris Charlton replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>...I have a Textarea that has several items input to it. I separate these items with a Comma, However my code inputs a Comma after every Entry. e.g. Item01, Item02, Item03,
When i update My Mysql Database with this string at present, after spliting it Using SPLIT functionality, My code adds a Further blank entry to the database. I would like to know how to stop writing in the last Comma to the Textarea. My code for the Textarea is Below...<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Just through in a <i>if</i> statement, or even something like <i>lastIndex</i> of a character (the comma) seeing if it's last or something to parse/ignore it, then either <i>break</i> or something more custom.

Hope that gets the noodle cookin'. <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Reply to this topic