聯(lián)系官方銷售客服
1835022288
028-61286886
求助大佬,自定義下拉框的php代碼,新手試了一晚上了,痛苦,幫看看哪里錯了。。。。
$code = '<select name="data" class="form-control"><option value="">';
$rt = \Phpcmf\Service::M()->db->table('admin_role_index')->where('roleid', '2')->get()->getResultArray(); //先取roleid=2所有人的uid
if ($rt) {
$rows = \Phpcmf\Service::M()->db->table('member')->where('uid', $rt['uid'])->get()->getResultArray(); //再取所有uid對應的名字
if ($rows) {
foreach ($rows as $t) {
$code = '<option value="'$t['username']'" > '$t['username']' </option>';
}
}
}
$code = '</select>';
1 框架數(shù)據(jù)查詢方法用的錯誤了
2 php基礎語法存在問題