PDA

View Full Version : Calling a PHP function to display Access DB Info ad-hoc



StriderDSO
13 Jun 2010, 07:35 PM
Hello all,

I'm wondering if it is possible for me to call a php function to display data from a database file I have on a page, with the use of a radio button or standard button?

I have a MS Access DB file which, for simplicity's sake, has columns A, B, and C. I am using PHP/ODBC to connect to the DB file and search for and display the entries for columns B and C based on what appears in column A (entries in A are all unique). The way I have it right now is that when the user loads the page for the first time, the relevant entry is listed.

However, I have some pages where I would like to display multiple rows of B & C data. The list of what can be valid for an individual page is rather long, and typically only a single B&C value is necessary for our job at any given time, so, I want to display only a single DB return at a time.

So, what I was wondering is if it would be possible for me to have a page that lists (in a standard UL list) each frequency (the data in A) only, with say, a radio button at the end of each <li> element. When the user selects/clicks the radio button, a PHP call will be executed to extract the associated B&C values from the database, and then display them.

I am hoping to have these values (B&C) load into a small iframe on the main page, so that after selecting the radio button, the whole page does not have to be reloaded, but only the iframe displaying the returned PHP results. That way, we could select one radio button, get the needed info from the iframe, and then select another, and another, never having to reload the root page.

So does any of this sound possible? Perhaps using javascript for the onclick of the radio button? Any advice would be appreciated. Thanks!

Greg