Hi
I have a php script to export data from mysql to excel with
header("Content-Type: application/vnd.ms-excel");
$sql = "SELECT * FROM table ";
$result = mysql_query($sql);
$numRows = mysql_num_rows($result);
for ($row = 1;$row <= $numRows; $row++){
$rowArray = mysql_fetch_row($result);
$ar1 = $rowArray[1];
$var2 = $rowArray[2];
echo $var1."<br>";
echo $var2."<br>";
}
Those values are as int(4) in mysql
The problem is when I open the excel the values are not integer he shows them as standard value and I ca't export them to SPSS
because he works with integers
Is there a way to force the variables to be exported from mysql to excel as integer only
Thanx in advance
Peppe