SQL语句改成这样试试;
select * from table1 where table1.flag = 1 union all select * from table2 where table2.flag = 1 union all select * from table3 where table3.flag =1
select * from table1 where table1.flag = 1 union all select * from table2 where table2.flag = 1 union all select * from table3 where table3.flag =1
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.xls");
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
?>
存储过程在4.1开始支持。针对楼主的需求,4.0以上就行了,
另外,sql语句有问题,注意语法格式,就像数学运算中的括号一样,别忘了:)呵呵