illy_max Posted March 24, 2010 Share Posted March 24, 2010 What I need to do is add "vchSiteName" (which comes from tblThirdPartyMemberInfo ) to the dynamically generated input tag name="chk{$arrMemberTotalInfo[arrMemberTotalInfo].intMemberId}_{$abc}" This is what I have tried: name="chk{$arrMemberTotalInfo[arrMemberTotalInfo].intMemberId}_{$abc}_{$arrMemberAccessInfo[arrMemberAccessInfo].vchSiteName}" and name="chk{$arrMemberTotalInfo[arrMemberTotalInfo].intMemberId}_{$abc}_{$siteName}" :: PHP File :: $query="select * from tblMemberMaster order by intMemberId"; $arrMemberTotalInfo=array(); $arrMemberAccessInfo=array(); if($arrMemberTotalInfo=ExecPaging($query,$parameter,$pagesize)) { for($i=0;$i<count($arrMemberTotalInfo);$i++) { $mid=$arrMemberTotalInfo[$i]['intMemberId']; //$getMemberAccessInfo=fnDisplayRecords("tblThirdPartyMemberInfo TPMI","TPMI.*","TPMI.intMemberId='".$arrMemberTotalInfo[$i]['intMemberId']."'","intSiteId",0); $getMemberAccessInfo=fnDisplayRecords("tblThirdPartyMemberInfo TPMI","TPMI.*","TPMI.intMemberId='".$arrMemberTotalInfo[$i]['intMemberId']."'","intSiteId",0); while($memberAccessInfo=mysql_fetch_array($getMemberAccessInfo)) { $sid=$memberAccessInfo['intSiteId']; $siteName=$memberAccessInfo['vcSiteName']; // I need to add this to the name!! $arrMemberAccessInfo[$mid][$sid]=$memberAccessInfo['enumStatus']; $arrMemberAccessInfo[$mid]['intSiteId'][]=$sid; } } } :: Smarty File :: {section name=arrMemberAccessInfo loop=$ctr} {assign var="abc" value=$smarty.section.arrMemberAccessInfo.index} {assign var="abc" value=$abc+1} {if $abc neq '1' && $abc neq '6' && $abc neq '7'} <td align="center"> <input type="checkbox" name="chk{$arrMemberTotalInfo[arrMemberTotalInfo].intMemberId}_{$abc}_{$arrMemberAccessInfo[arrMemberAccessInfo].vchSiteName}" {if $arrMemberAccessInfo[$memId][$abc] eq 'A'} checked {/if} onchange="setAcess(this,'{$arrMemberAccessInfo[$memId][$abc]}','{$memId}','{$abc}');"> <input type="hidden" name="hdn{$arrMemberTotalInfo[arrMemberTotalInfo].intMemberId}_{$abc}" value=""> </td> {/if} {/section} Thank you very much for any help. Link to comment https://forums.phpfreaks.com/topic/196421-please-help-php-smarty-and-mysql/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.