0

不明な問題で立ち往生しました。挿入クエリを実行すると、これが表示されます..

Unknown column 'first_val' in 'field list'insert into test_element set `test_id`='100238', `title`='sdd', `unit`='ds', `first_val`='2', `last_val`='33', `status`='', `create_date`='1366873602'

ここでエラーを見ることができます...そして私のmysqlテーブルはこのようなものです ここに画像の説明を入力

私のhtmlフォームは次のとおりです。

 <select id="test" name="test" disabled="disabled" />{test_element_name_list}</option>
                           <div style="display: none;" id="d1"></div>
                           <br />                   
                        </td>
                     </tr>
                     <tr class="dark_txt2">
                        <td width="13%">
                           <span class="Required">*</span>Title:                    
                        </td>
                        <td width="87%">
                           <input id="title" name="title" value="{title}" class="Field400" type="text" style="width:300px" />
                           <div style="display: none;" id="d1"></div>
                           <br />                   
                        </td>
                     </tr>
                     <tr class="dark_txt1">
                        <td width="13%">
                           <span class="Required">*</span>Unit:                 
                        </td>
                        <td width="87%">
                           <input id="unit" name="unit" value="{unit}" class="Field400" type="text" style="width:300px" />
                           <div style="display: none;" id="d1"></div>
                           <br />                   
                        </td>
                     </tr>
                     <tr class="dark_txt1">
                        <td width="13%">
                           <span class="Required">*</span>First Value:                  
                        </td>
                        <td width="87%">
                           <input id="first_val" name="first_val" value="{first_val}" class="Field400" type="text" style="width:300px" />
                           <div style="display: none;" id="d1"></div>
                           <br />                   
                        </td>
                     </tr>
                      <tr class="dark_txt1">
                        <td width="13%">
                           <span class="Required">*</span>Last Value:                   
                        </td>
                        <td width="87%">
                           <input id="last_val" name="last_val" value="{last_val}" class="Field400" type="text" style="width:300px" />
                           <div style="display: none;" id="d1"></div>
                           <br />                   
                        </td>
                     </tr>

関数の助けを借りて投稿を挿入しますが、なぜ私のデータがmysqlテーブルに入らないのか困惑しています。コードは次のとおりです。

$SQL="insert into test_element set
    `test_id`='$R[test_id]',
    `title`='$R[title]',
    `unit`='$R[unit]',
    `first_val`='$R[first_val]',
    `last_val`='$R[last_val]',
    `status`='$R[status]',
    `create_date`='$date'";

これを整理するために多くの時間を費やしてください。どんな助けでも大歓迎です...事前に感謝します

4

2 に答える 2

2

これを試してみてください

INSERT INTO table_name (column1, column2) VALUES('demo', 'demo');

そうでない場合は、間違ったテーブル名を使用しているか、その列がなく、他のテーブルのプレビューを表示しています

于 2013-04-25T07:31:05.810 に答える