开始查询以显示结果:
$at = array();
$num=array();
$i=0;
while($rw=mysql_fetch_array($r))
{
echo $rw['c_number']
$number=$rw['c_number'];
$num[$i]=$number;
$i++;
echo $rw['total'];
$at[] = $rw['total'];
}
// 这个查询的结果是这样的:
Mobile numbers bills
03455919448 34
03215350700 56
03474738923 678
03573987932 344
03187438979 1324
// 现在想把它插入数据库
$d= 'november';
foreach($num as $num1){
$sql = "insert into billing details(bill,month/year,c_number) values ('$at','$d','$num')";
mysql_error();
$result = mysql_query($sql);
}
// 最后的插入查询不起作用并给我错误:
MySQL returned an empty result set (i.e. zero rows). ( Query took 0.0004 sec )