Hi,
I have a table, constructed in PHP that displays results from a mysql table.
Like so:
$sql = mysql_query("SELECT * FROM survey");
echo "<table border='1'>
<tr>
<th>Question 1</th>
<th>Question 2</th>
<th>Question 3</th>
<th>Question 4</th>
<th>Question 5</th>
<th>Question 6</th>
<th>Question 7</th>
<th>Question 8</th>
<th>Question 9</th>
<th>Question 10</th>
<th>Question 11</th>
<th>Question 12</th>
<th>Question 13</th>
<th>Question 14</th>
<th>eMail</th>
</tr>";
while ($row = mysql_fetch_array($sql))
{
echo "<tr>";
echo "<td>" . $row['Question1'] . "</td>";
echo "<td>" . $row['Question2'] . "</td>";
echo "<td>" . $row['Question3'] . "</td>";
echo "<td>" . $row['Question4'] . "</td>";
echo "<td>" . $row['Question5'] . "</td>";
echo "<td>" . $row['Question6'] . "</td>";
echo "<td>" . $row['Question7'] . "</td>";
echo "<td>" . $row['Question8'] . "</td>";
echo "<td>" . $row['Question9'] . "</td>";
echo "<td>" . $row['Question10'] . "</td>";
echo "<td>" . $row['Question11'] . "</td>";
echo "<td>" . $row['Question12'] . "</td>";
echo "<td>" . $row['Question13'] . "</td>";
echo "<td>" . $row['Question14'] . "</td>";
echo "<td>" . $row['eMail'] . "</td>";
}
echo "</table>";
What I want to do is output this table into an excel file, without any source code, or table tags. Is there a way I can do this? I've been overwhelmed with information on the internet and not quite sure what I need.
If possible I'd prefer to do this with just PHP, and without any additional libraries.