[請益] 有關smarty跟ADOdb的問題

看板PHP作者 (至尊俠盜小短褲)時間13年前 (2012/07/04 11:54), 編輯推噓0(004)
留言4則, 2人參與, 最新討論串1/1
簡單說明 我在html的語法應該沒問題 因為有讀到資料 但sumbit之後 到php要更新資料 執行UPDATE語法 就發現PHP執行完 無錯誤訊息 但SQL語法沒有執行成功 資料還是原來的樣子 不知道是不是array變數那邊有問題? 我自己對smarty跟ADOdb完全是新手 就不知道php語法要改成什麼樣 才是對的 煩請高手解答 謝謝 http://www.FunP.Net/89692 與下面相同 只是放在一個TXT中 下面是html的部份 <{section name=c loop=$arrList}> <tr> <td><input id="grpmbr_no>" name="grpmbr_no>" type="text" class="small" value="<{$arrList[c].grpmbr_no}>"/> </td> <td><input id="grpmbr_name>" name="grpmbr_name>" size="20" type="text" value="<{$arrList[c].grpmbr_name}>" /></td> <td><{if $arrList[c].grpmbr_sex == 1}>男<{else}>女<{/if}>/td> <td><input id="grpmbr_birthday>" name="grpmbr_birthday>" size="10" type="text" value="<{$arrList[c].grpmbr_birthday}>" /></td> </tr> <tr> <td><input id="grpmbr_idcard>" name="grpmbr_idcard>" size="20" type="text" value="<{$arrList[c].grpmbr_idcard}>" /></td> <td><input id="grpmbr_unit>" name="grpmbr_unit>" size="20" type="text" value="<{$arrList[c].grpmbr_unit}>" /></td> <td><input id="grpmbr_tel>" name="grpmbr_tel>" size="20" type="text" value="<{$arrList[c].grpmbr_tel}>" /></td> <td><input id="grpmbr_email>" name="grpmbr_emai>" size="25" type="text" value="<{$arrList[c].grpmbr_email}>" /></td> </tr> <{/section}> 下面是php的語法 for ( $i = 1;$i <= count($this->_HTML["arrList"]); $i++) { $record = array(); $record['grpmbr_no'] = $this->arrList[$i]['grpmbr_no']; //團體編號 $record['grpmbr_name'] = $this->arrList[$i]['grpmbr_name']; //姓名 $record['grpmbr_sex'] = $this->_HTML["arrList"][$i]['grpmbr_sex']; //性別 $record['grpmbr_birthday'] = $this->_HTML["arrList"][$i]['grpmbr_birthday'];//生日 $record['grpmbr_idcard'] = $this->_HTML["arrList"][$i]['grpmbr_idcard']; // 身分證 $record['grpmbr_unit'] = $this->_HTML["arrList"][$i]['grpmbr_unit']; //服 務單位/學校 $record['grpmbr_tel'] = $this->_HTML["arrList"][$i]['grpmbr_tel']; //聯 絡電話 $record['grpmbr_email'] = $this->_HTML["arrList"][$i]['grpmbr_email']; //email $this->DB->AutoExecute("groupmember", $record, 'UPDATE', "grpmbr_no = '" . $this->arrList[$i]['grpmbr_no'] . "'"); } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 111.250.6.76

07/04 13:02, , 1F
你要不要給個錯誤訊息 或者敘述錯誤部份詳細點?
07/04 13:02, 1F

07/04 13:37, , 2F
沒錯誤訊息 但SQL語法沒執行成功
07/04 13:37, 2F
※ 編輯: toyhsu 來自: 111.250.6.76 (07/04 13:39) ※ 編輯: toyhsu 來自: 111.250.6.76 (07/04 13:57)

07/04 18:17, , 3F
先Var_dump(); 看有沒有資料傳過來?
07/04 18:17, 3F

07/09 11:16, , 4F
dump完 資料是NULL 囧 看來一開始就錯了....
07/09 11:16, 4F
文章代碼(AID): #1Fyxw04B (PHP)
文章代碼(AID): #1Fyxw04B (PHP)