Forum Home
Press F1
 
Thread ID: 110135 2010-06-05 00:37:00 access SQL data from html Mike (15) Press F1
Post ID Timestamp Content User
1106894 2010-06-05 00:37:00 I want to access some data stored in a SQL table and display it in an html page.

Can it be done?

both the HTML page and the SQL table are on my machine, and they won't be going anywhere else (local only). The SQL table is updated hourly, and I only need to display the most recent record (they are timestamped)

How can I do this? Will I need to use something like vbscript? the page is not going to go through a server, so can't have any server-sided tools (otherwise that would be easy ;))

Can anyone help?

Cheers,
Mike.
Mike (15)
1106895 2010-06-05 00:43:00 You will need _something_ server side to interact with the database. If the table is only updated hourly, your best bet is to have a scheduled job which runs every hour and regenerates the html page based on the latest data in the database. somebody (208)
1106896 2010-06-06 03:38:00 Well, it will have to be server-side, because that's where you say the data is, plus that's where you appear to be viewing it. If you want something truly dynamic, you'll have to install a webserver of some sort. But if you just want to generate some html every hour, then you could script a batch file (which could be VBScript or JavaScript with the standard MS cscript program) to do the job every hour.

As for languages, as well as the 2 the above, anything goes. You can easily install PHP or Perl or Python, but anything could do it - just depends on what you're prepared to do & where your preferences lie. The 5 I've mentioned all have simple methods to access SQL databases in a pretty straightforward way.
MushHead (10626)
1