时间:2021-07-01 10:21:17 帮助过:14人阅读
multi_query('CALL UP_User_GetCardInfo("'.$condition.'","'.$page.'","900000")') or die($mysqli->error);$query = $mysqli->store_result(); while ($record = mysqli_fetch_array($query, MYSQLI_BOTH)){ $phone = $record['phone']; $cardid = $record['cardid']; $charge = $record['charge']; $achieve = $record['achieve']; $chgdate = $record['useDate']; echo "\n"; echo $phone."\t"; echo $cardid."\t"; echo $charge."\t"; echo $achieve."\t"; echo $chgdate."\t"; }if(is_object($query)) $query->free_result();$mysqli->next_result(); ?>
没人!
用另外一种方法也是一样的效果,代码如下:
$val){ $title[] = $key; $field[] = $val;}#$query = $mysqli->query("select uid,username,phone from ccna_members limit 10") or die($mysqli->error);#$query = $mysqli->multi_query("select * from ccna_members limit 10") or die($mysqli->error);$query = $mysqli->multi_query($_SESSION["exp_sql"]) or die($mysqli->error);$query = $mysqli->store_result();//$csv_data = array(array('uid', 'username'));//所有记录就存这啦$csv_data = array(array());//压入表头,将字段放到第一行for ($i=0; $i < count($field); $i++) { $csv_data[0][$i]= $field[$i];}while($row = mysqli_fetch_array($query,MYSQLI_BOTH)){ //array_push($csv_data, array($row[0],$row['username'])); $row_array = array(); for ($i=0; $i < count($title); $i++) { #array_push($row_array,iconv("utf-8","gb2312",$row[$title[$i]])); array_push($row_array,$row[$title[$i]]); } array_push($csv_data,$row_array);}exportToCsv($csv_data,$_SESSION["exp_filename"].".csv");?>
echo $cardid."\t";
改为
echo “‘$cardid\t";
echo $cardid."\t";
改为
echo “‘$cardid\t";
怎么可能,你产生的就是文本文件,只不过后缀不同罢了
怎么可能,你产生的就是文本文件,只不过后缀不同罢了
"’$cardid\t";
有个单引号
是也在想:字太小可能看不清
"’$cardid\t";
有个单引号
是也在想:字太小可能看不清
?成字符串就可以了。