Note that there are some explanatory texts on larger screens.

plurals
  1. PODownload Data from HTML table to excel
    primarykey
    data
    text
    <p>I have a table, constructed in PHP that displays results from a mysql table.</p> <p>Like so:</p> <pre><code>$sql = mysql_query("SELECT * FROM survey"); echo "&lt;table border='1'&gt; &lt;tr&gt; &lt;th&gt;Question 1&lt;/th&gt; &lt;th&gt;Question 2&lt;/th&gt; &lt;th&gt;Question 3&lt;/th&gt; &lt;th&gt;Question 4&lt;/th&gt; &lt;th&gt;Question 5&lt;/th&gt; &lt;th&gt;Question 6&lt;/th&gt; &lt;th&gt;Question 7&lt;/th&gt; &lt;th&gt;Question 8&lt;/th&gt; &lt;th&gt;Question 9&lt;/th&gt; &lt;th&gt;Question 10&lt;/th&gt; &lt;th&gt;Question 11&lt;/th&gt; &lt;th&gt;Question 12&lt;/th&gt; &lt;th&gt;Question 13&lt;/th&gt; &lt;th&gt;Question 14&lt;/th&gt; &lt;th&gt;eMail&lt;/th&gt; &lt;/tr&gt;"; while ($row = mysql_fetch_array($sql)) { echo "&lt;tr&gt;"; echo "&lt;td&gt;" . $row['Question1'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['Question2'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['Question3'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['Question4'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['Question5'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['Question6'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['Question7'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['Question8'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['Question9'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['Question10'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['Question11'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['Question12'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['Question13'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['Question14'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['eMail'] . "&lt;/td&gt;"; } echo "&lt;/table&gt;"; </code></pre> <p>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. </p> <p>If possible I'd prefer to do this with just PHP, and without any additional libraries.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload