ColdFusion

Moderators: None (Apply to moderate this forum)
Number of threads: 19
Number of posts: 37

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
SplitVar Posted by moiseszaragoza on 15 Jul 2009 at 6:11 AM
[PHP] <cfset SplitVar = #URL.modelID# />
<cfquery datasource="XXXXXXX" dbname="XXXXXX" name="get_memb">

SET QUOTED_IDENTIFIER OFF
INSERT INTO ModelToPart
(modelID,ModelPartID)
VALUES

<cfloop index="intI" from="1" to="#(ListLen( SplitVar, ',' )-1)#" step="1">
<cftry>


('#URL.modelID#',' #ListGetAt( SplitVar, intI+1, "," )#')
,
<cfcatch>
ERROR: #CFCATCH.Message#
</cfcatch>
</cftry>
</cfloop>


</cfquery>
<cflocation url="http://www.modelproductions.com/book_NweProjct_viewPart.cfm?modelProjectID=#URL.modelProjectID#">[/php]

I am using the code above to create a Query that inserts multiple records.

Buy I have a extra coma at the end.

how can i have it that the last coma does not sohw

Thanks





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.