Jump to content

Ajax/java/php sum problem


pb1uk

Recommended Posts

Hello all,

 

I'm having a problem with adding up the values that are displayed in a table.

 

I won't copying and paste all my source code here as there is a lot of it and i think people could understand my problem abother way.

 

If you look at the following link:

 

http://www.w3schools.com/PHP/php_ajax_database.asp

 

This shows a drop down menu which when selected brings information held in a database based on the selection.

My code is adapted from that of the link above, except i have two drop down menus both accessing different tables in the database.

 

What i'm trying to do is when the user selects an option from the drop down menus, in a table below the total age is summed.

 

For example from the link above if the user selected Peter Griffin from the first menu and Lois Griffin from the second menu in a table below their combined

age would be calaculated (in this example 40+41 so 81 would be displayed below)

 

I've searched high and low and this has been causing me problems for weeks now, any help or adivce would be greatly appreciated.

 

Thanks for taking the time to read this.

 

Pete

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...