作者toyhsu (至尊侠盗小短裤)
看板PHP
标题[请益] 有关smarty跟ADOdb的问题
时间Wed Jul 4 11:54:36 2012
简单说明
我在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
1F:→ kuAIpAI:你要不要给个错误讯息 或者叙述错误部份详细点? 07/04 13:02
2F:→ toyhsu:没错误讯息 但SQL语法没执行成功 07/04 13:37
※ 编辑: toyhsu 来自: 111.250.6.76 (07/04 13:39)
※ 编辑: toyhsu 来自: 111.250.6.76 (07/04 13:57)
3F:→ kuAIpAI:先Var_dump(); 看有没有资料传过来? 07/04 18:17
4F:→ toyhsu:dump完 资料是NULL 囧 看来一开始就错了.... 07/09 11:16