mysql查询的结果怎么赋给一个变量
1个回答
展开全部
打开结果集 用游标循环取值,
$sql_str='select * from DEPARTMENTS where SUPDEPTID='.$SUPDEPTID.' order by DEPTID ';
$rs=$conn->Execute($sql_str);
echo "ok";
while(!$rs->eof){
$row_arr=array();
$row_arr['id']=$rs->fields["DEPTID"]->value;
$row_arr['text']=iconv( "gb2312", "UTF-8//IGNORE" , $rs->Fields['DEPTNAME']->value);
$row_arr['DEPTID']=$rs->fields["DEPTID"]->value;
$row_arr['DEPTNAME']=iconv( "gb2312", "UTF-8//IGNORE" , $rs->Fields['DEPTNAME']->value);
$row_arr['SUPDEPTID']=$rs->fields["SUPDEPTID"]->value;
$row_arr['UPDEPTNAME']=$UPDEPTNAME;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询