データベースにデータを挿入する大きなテーブルがあります。問題は、ユーザーがテーブルを編集するときです。
- クエリを実行する
value="<cfoutput>getData.firstname#</cfoutput>
入力ボックスのようにたくさんの行を使用してください。
cfc または cfm ファイルを介してフォーム入力ボックスをデータベースにバインドする方法はありますか?
どうもありがとう、
R
データベースにデータを挿入する大きなテーブルがあります。問題は、ユーザーがテーブルを編集するときです。
value="<cfoutput>getData.firstname#</cfoutput>
入力ボックスのようにたくさんの行を使用してください。cfc または cfm ファイルを介してフォーム入力ボックスをデータベースにバインドする方法はありますか?
どうもありがとう、
R
挿入クエリですべての列名を指定する必要がない簡単な方法を探している場合、cfinsert は、送信したすべてのフォーム名をデータベース列名にマップしようとします。
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7c78.html
を見て<cfgrid>
ください。テーブルを編集していて、行ごとに 1 つの更新を起動できる場合が最も簡単です。
XSS に対するセキュリティのために、タグ <input value="#xmlFormat(getData.firstname)#">
の数を最小限に抑えるためにを使用する必要があります。を使用する場合は不要です。<cfoutput>
XmlFormat()
<cfinput>
Query objects include the columnList, which is a comma-delimited list of returned columns.
If security and readability aren't an issue, you can always loop over this. However, it basically removes your opportunity to do things like locking certain columns, reduces your ability to do any validation, and means you either just label the form boxes with the column names or you find a way to store labels for each column.
You can then do an insert/update/whatever with them.
I don't recommend this, as it would be nearly impossible to secure, but it might get you where you are going.
CF 9 を使用している場合は、このオンラインの章 https://www.packtpub.com/sites/default/files/0249-chapter-4-ORMで説明されているように、ORM (Object Relation Management) 機能を (CFC 経由で) 使用できます。 -Database-Interaction.pdf (pdf の 6 ページから)