-
Need Scripts To Display SQL Data On A Web Site
I need a script (or set of scripts) that will pull data elements from an SQL database, package them (as XML?) and push the file to a web site where the data will be displayed (probably in a table). Details: I want to retrieve incident information from a public safety database and display that information in real or near real-time on a web page. The database resides on a server inside a domain, and needs to be FTP'ed to a web site on the world wide web.
Thanks for reading,
Ed
-
-
I have managed to get data from a MYSQL database using PHP.
I extracted all the data required into an array using PHP.
I then converted that array into a javascript array.
I was then able to interrogate the array for a specific element, chosen using SELECT OPTION in a form, and extract the individual fields using .split. I culd then display the individual fields for a specific MYSQL record.
I have also used a for loop to display the elements to the screen.
The most difficult part of this for me was converting the PHP array into a javascript array.
If any of this would help you then let me know
-
-
I'm learning about this as well. You don't really need JS to interpret the array; use the echo command to write your table directly from php. Start here, here, and here.
-
-
The echo command is perfect for presenting the contents of the table, however, I found that if I wanted to create the OPTIONS for a SELECT in a form, choose a record and display the details of that then using a javascript was the best way.
This way I could retrieve all of the base data that I needed, allow a choice to be made, display and use the relevant field data and accept other input.
I use this method when creating a HTML email, the data table contains addresses, contact details, etc for a number of companies. The selection of the company fills in certain fields, the main details of the email are entered and the email is sent.
I use Formmail for the email, mainly because I like its validation, flexibility and most importantly - it's free
-
-
Site Designers
: There are many reasons why you might like to edit your site content via the net, including ease of use, multiply editor for a site and even a single page as well as authorization of users. Luckily, there are several "Content Editor" on the market that come to the rescue, and in this post we will like to recommend Toko Content Editor.
-
-
Do you have a working example I can view?
-
-
try this link, the initial PHP is to set up the OPTIONS in a select box from the contents of the table.
It also sets up a delimited array which is then converted into a JS array.
There is then a JS funtion which takes the selected OPTION and retrieve the relevant data from the JS array and displays the fields on the form.
The only thing to ensure is that the first field in the array is also the field on which the PHP sort is done and that is used in setting the SELECT options.
www.cognac-jaugeage.com/jaugeage-formmail.php
-
-
-
-
sorry, typo
http://www.cognac-jaugeage.com/jaugeage_formmail.php
If you look at the input field Drire the OPTIONS are populated from the database, the address details etc are populated by reading a JS array originally created by PHP.
The HTML email is created by FormMail, a free HTML email program.
Please don't create an email, this is a production system, ie it's live
If this is type of thing that you want then I can send you a stripped down, reasonably commented version that does this.
-
-
Not quite what I am looking for. See http://www.nashfire.org/live_inci/Incident.htm for an example.
Ed
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks