Header ("Content-type:application/vnd.ms-execl");
Header ("Content-disposition:filename=test.xls");
$con _db = mysql_connect ("localhost", "root", "patest");
mysql_select_db ("Dataput", $con _db);
$d = 0;
for ($i =0; $i <6; $i + +)
{
$sql = "INSERT into Progress (day,city) VALUES (' $d ', ' $i ')";
$insertdb _result=mysql_query ($sql, $con _db);
echo $i. "
";
$d + +;
}
The discovery data did not insert 6 data as expected, please enlighten the master
Reply to discussion (solution)
I don't know what you're doing.
For two purposes:
1. Inserting data into the DB
2. Echo, display some data on the page
You are now having problems inserting the database.
Or so, what does the above code do?
There is no output on the page because you use the header ("Content-type:application/vnd.ms-execl");
As for the inability to insert the library, you can open the saved Test.xls to read the newspaper what's wrong.
Yes, there is no output on the page.
But it is not impossible to insert the database but the expected is to insert 6, but inserted 12, have the same data repeated insertion (my main confused place)