Skip to main content
Harm_Millaard
Inspiring
July 7, 2011
Question

Basic help with radio buttons and functions

  • July 7, 2011
  • 1 reply
  • 1206 views

I have a page, http://ppbm5.com/DB-PPBM5-3.php

which contains several radio button groups in tabbed panels. I can use the alert function to display the clicked button to see the value of the selected button.

I need to use that value to create a WHERE statement to requery a mySQL database in a real-time manner.

For instance:

When clicking on 'Asus' in the Manufacturer panel, I need to modify the query to:

$new_query = $old_query . "Manufacturer LIKE " .  "the variable now shown as Asus" . "ORDER BY Total, RPI ASC"

and then:

$Result = mysql_query( $new_query, $mysql)

How do I make this work?

I want to have a situation where the database is requeried everytime a radio button is clicked and updated in real time.

This topic has been closed for replies.

1 reply

July 7, 2011

You have already posted this question several times and a solution was provided, but you said you were unsuccessful. You did not express desire to pursue the solution and instead decided to attempt your own method. It's useless for others to provide solutions if you do not use them.

http://forums.adobe.com/thread/871475

best,

Shocker

Harm_Millaard
Inspiring
July 7, 2011

Maybe you would be willing to help me along, since as I have made clear, I am unsuccesfull in making the bought SpryDataTools to work and it is at this moment a complete waste of money. Sure, being such a noob, I probably f*cked up along the way,

Actually, the question is IMO much more basic than you may assume.

I have the function report the value in the alert box. That part is now figured out.

All I need now is to get it into a variable and construct a WHERE string that calls a function with that variable.

For experts like yourself, this must be such a duuuhhh question, but for me it is a problem.

As I told a friend, once you get the varaible it is pretty simple.

$query_Recordset  = 'SELECT *, FORMAT(`RPI`,2) As RPI,`CPU`*`Cores` As Phys_Cores, `OS  disks`+`Project disks`+`Output disks` as Disks, FORMAT(`Gain`,1) As Gain  FROM `Personal_data`,`Benchmark_results` WHERE Personal_data.Ref_ID =  Benchmark_results.Ref_ID'

$New_Query = obj.value

$query_Sort = ' ORDER BY Total, RPI ASC'

and then concatenate them into a new query string,

$query = "$query_Recordset" .  "$New_Query" . "query_Sort"

and then execute a mysql_query function with ($query, $mysql) as variables .

Coming from an APL background, I find this type of coding extremely  wasteful, I mean I could do a Cholesky matrix decomposition on any sized  array in only 4 lines of code, and now this simple stuff seems to take  hundreds of lines of code. It is like returning to Cobol or RPG.

APL example to calculate the average of any series along the rows: (+/A)/ρA

Want to do that on a second dimension of an array (columns for instance): (+/A[2])/ρA[2]

What could be easier than that? Matt Iverson, a Harvard mathematical  professor was the founder of this A Programming Language (hence the  short name APL) to teach his students and I have been a big fan of it.