Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8689651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:42:14+00:00 2026-06-12T23:42:14+00:00

I have a survey site that collects data from user inputs and stores it

  • 0

I have a survey site that collects data from user inputs and stores it in MySQL.

I want some users to be able to go to a page that allows them to download a formatted excel file of the data (note, not a csv).

I’ve heard ODBC allows you to interface excel with MySQL, but can’t find any server side applications for it.

Is it possible?

I’m using PHP for the site.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:42:15+00:00Added an answer on June 12, 2026 at 11:42 pm

    Exporting a database to an excel file should not be difficult since excel can read xhtml.

    Just output your information as a regular HTML table

    <table>
    <tr>
    <td>title</td>
    </tr>
    <tr>
    <td>record1</td>
    </tr>
    </table>
    

    and then add these headers to force automatic download and interpretation as an excel file:

    header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header ("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT");
    header ("Cache-Control: no-cache, must-revalidate");
    header ("Pragma: no-cache");
    header ("Content-type: application/x-msexcel");
    header ("Content-Disposition: attachment; filename=\"{$yourFileName}\"" );
    header ("Content-Description: PHP Generated Data" );
    

    It should work as intended.

    EDIT:
    Here’s an example of a table to xls with correct XHTML schema:

    <?php
    header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header ("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT");
    header ("Cache-Control: no-cache, must-revalidate");
    header ("Pragma: no-cache");
    header ("Content-type: application/x-msexcel");
    header ("Content-Disposition: attachment; filename=newtest.xls" );
    header ("Content-Description: PHP Generated Data" );
    ?>
    <html xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
    <head>
    <meta name="Excel Workbook">
    <meta http-equiv=Content-Type content="text/html; charset=utf-8">
    <meta name=ProgId content=Excel.Sheet>
    <meta name=Generator content="Microsoft Excel 14">
    <style>
    #test
    {
        font-style:italic;
    }
    </style>
    </head>
    <body>
    <table>
        <tr>
            <td><b>header in bold</b></td>
            <td><i>header in italic</i></td>
        </tr>
        <tr>
            <td>1</td>
            <td><span style="font-weight:bold; font-style:italic">my data with css styling</span></td>
        </tr>
        <tr>
            <td>2</td>
            <td><span id="test">I'm italic 'cause I can read style</span></td>
        </tr>
    </table>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some survey data that I want to describe by political party and
So I have this survey that I am pulling results from and I have
I have a table of data with survey results, and I want to do
I have created a website survey that is in the footer of our site.
I have a dataset that has patient data according to the site they visited
I have a survey-type form that's being populated from a web database on the
I have survey data of species richness that was taken at various sites in
I have an online survey for my users, and every time user answers a
I have a survey on a website, and there seems to be some issues
I have a survey application, where users can create surveys and give choices for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.