当前位置:Gxlcms > PHP教程 > php导出非乱码非乱序奇葩有关问题求大神挫进来帮帮小弟

php导出非乱码非乱序奇葩有关问题求大神挫进来帮帮小弟

时间:2021-07-01 10:21:17 帮助过:6人阅读

php导出非乱码非乱序 奇葩问题求大神挫进来帮帮小弟


上面第一个图是导出后的效果图,第二张是数据库实际数据,细心的哥们就发现导出的图后三位全部变为0,这神马情况啊

求大神指点
代码如下:

define('NOROBOT', true);
define('CURSCRIPT', 'charge');
require_once './include/common.inc.php';


header("Content-type:application/vnd.ms-excel;charset=utf-8");
header("Content-Disposition:attachment;filename=充值卡.xls");
$page = $page ?: 1;
$results = array();
$condition = '';

echo "被充值手机号"."\t";
echo "充值卡序列号"."\t";
echo "充值金额"."\t";
echo "实充额度"."\t";
echo "充值时间"."\t";

$query = $mysqli->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();





?>

------解决方案--------------------
"’$cardid\t";
有个单引号
是也在想:字太小可能看不清

人气教程排行