HI,
As john-formby you have to use AJAX. You can't connect to the MySQL server just only using javascript.
Main Topics
Browse All TopicsI have a list of checkboxes. Near each of them there is an icon of vegetable or fruit.
Now when I select one of this checkbox (for example : tomato ) , all the nutritional values for the chosen food will be selected from the database and will be presented one near one in a separate cell.
So in this way , i'm able to select several kind of foods and all their attached nutritional values
will appear immediately.
Is there a way to initiate a select query by selecting a check box from the PHP file ?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
what you could do is to load all nutritional data for every fruit or vegitable from db while creating the page, and create a hidding <div holding that info, when you click the check mark, you enable that <div (show it), when you unchick it, <div disapperas
good things: it is a very fast approach, fairly easier than ajax and stuff
bad things: you'll have to load all data from database and not of all these data shall be used. but i think it wont be that slow...
Business Accounts
Answer for Membership
by: john-formbyPosted on 2008-01-10 at 05:41:30ID: 20626988
Hi,.
hp/php_aja x_database .asp The example on the first page shows a select box but it could easily be changed to a checkbox.
I think your best option is to use AJAX to update automatically without having to resfresh the page. The following link should help you: http://www.w3schools.com/p
Hope this help,
John