Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Basic help with radio buttons and functions

LEGEND ,
Jul 07, 2011 Jul 07, 2011

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.

TOPICS
Server side applications
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 07, 2011 Jul 07, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 07, 2011 Jul 07, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 07, 2011 Jul 07, 2011

Can't create a Spry data set.

There is no way I can get it to work:

7-7-2011 20-02-51.png

Followed the instruction videos step by step, but no way does it work. So the solution provided was not a solution at all. Merely a suggestion to look at alternative approaches which did not work out.

If it does not work, you have to follow other roads.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 07, 2011 Jul 07, 2011
There is no way I can get it to work:

Mr. Millard,

No way? There is no way? Are you serious? There IS absolutely a way to get it to work since many others have been able to get it to work for them. Desire to pursue working methods is required along with detailed explanation of what you've tried so far that has resulted in the error message you receive. You have not provided the code for personal_data.xml and/or DB-PPBM5-3.php therefore you can not receive assistance in determining what the problem may be. Do you have your testing server properly defined as suggested in the error message? Upload the dynamic php to xml file to your server and provide a link to the file so others can see the xml syntax that is being produced from your php script.

If you want to tiss about it banging your fists on the ground saying there's no way to get it to work then well... I hope you somehow find a way to get it to work. If you want to describe the steps you've taken thus far then perhaps someone will be able to determine why you can not get it to work and suggest a way to get it to work for you. I have no desire to help someone that does not want to try the methods recommended.

best,

Shocker

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 07, 2011 Jul 07, 2011

Here are the links to both files

http://www.millcon.nl/Harm/Personal_data.xml

http://www.millcon.nl/Harm/DB-PPBM5-3.html

where the last file is just a renamed version of the php file, with the login data and password removed.

My testing server appears to be OK, seeing the V's behind the checkboxes. I have the server behavior in working order and according to the instruction video I need to go to the bindings menu and add a Spry data set. When I do that it always comes back with a schema not found.

I first enter the DB-PPBM5-3.php file and then browse to the Personal_data.xml for the Direct Feed Design. I can't get past this step. The .XML file was a direct export of the first record of the mySQL database from the host and saved locally. In my stupidity I expect that to be OK, but it really has been a trial and error effort over the last couple of days and I'm stuck.

Please let me know what further info you may want or need. I appreciate the help.

BTW, I also tried to export the current database as XML from the host and that gave the same problem. I tried to enter that as the source for the binding, but that did not work either. I also tried to figure out what XPath should be set to, but I have no idea.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 07, 2011 Jul 07, 2011

Hello friend,

http://www.millcon.nl/Harm/Personal_data.xml has an error message that says

error on line 21 at column 14: error parsing attribute name

Below is a rendering of the page up to the first error.


Line 21 with the error is:

<Date & Time>2011-03-27 12:34:52</Date & Time>

Date & Time is not a preferred method for valid xml tag naming convention. Ideally you would have lowercase, no spaces, and no special characters ie date_and_time

Fix that for all tags and you should be able to create dataSet. Let us know if you have any other problems.

best,

Shocker

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 07, 2011 Jul 07, 2011

It being 01:20 AM locally I will try to correct that tomorrow and first get some sleep. Thanks for your help and I will let you know how it worked out.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 08, 2011 Jul 08, 2011
LATEST

Thanks a lot for that tip about the field names. I changed them a bit, removing blanks and replacing them with underscores and I got the data set in order. Huge progress from my point of view. Couple of things still need tidying up before I can move on to the queries.

1. What code can I delete now on the page? It looks to me that first the SQL data get loaded and then the Spry data set. It looks to me like doing it twice. BTW I have updated the .html file to reflect todays work.

2. What can I do to prevent the short display of all the radio buttons when loading the page?

3. When I sort on a certain column, is there any way to sort the resulting sequence (with ties) on a second column? Say I'm sorting on CPU, how can I sort on a second column like rank, so I can see all the "X" CPU's ordered by their Rank? Rank will always be the second column to sort on.

Then of course the major work is how do I get the string values, now displayed in alert boxes into strings for my WHERE statements?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines