473,320 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to retrieve data based on multiple checkbox selections

I am creating a recommended education plan for our website. The thought was to have someone choose their top 3 functions , hit submit and based on the selection a list of courses are displayed. I have created the database. I have created the form. Please advise on the best way to make this happen.
Apr 26 '10 #1
5 5216
Frinavale
9,735 Expert Mod 8TB
The user would hit a button or something to submit the form to your PHP code.
In your PHP code you would detect what the user checked off, create your SQL Query based off of what they selected and then would update the database accordingly.


-Frinny
Apr 26 '10 #2
@Frinavale
I do not want to do any data entry. I already have the data needed. I want the user to be able to choose from 3 options and the data associated with those options populate.
Apr 27 '10 #3
Frinavale
9,735 Expert Mod 8TB
Oh do you mean you want to Display the (Text) descriptions for checkboxes based on something you've retrieved from the database??

-Frinny
Apr 27 '10 #4
@Frinavale
Yes exactly :)
Apr 27 '10 #5
Frinavale
9,735 Expert Mod 8TB
You need to state what you need help with more clearly in the future.
It would also Really help if you specified What programing language you're using to develop this application.

I'm assuming that you are using PHP... just because the PHP/MySql package is so sweet.

So here is a code snippet showing you how to connect to a database and retrieve data:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $con = mysql_connect("localhost","peter","abc123");
  3. if (!$con)
  4.   {
  5.   die('Could not connect: ' . mysql_error());
  6.   }
  7.  
  8. mysql_select_db("my_db", $con);
  9.  
  10. $result = mysql_query("SELECT * FROM Persons");
  11.  
  12. while($row = mysql_fetch_array($result))
  13.   {
  14.   echo $row['FirstName'] . " " . $row['LastName'];
  15.   echo "<br />";
  16.   }
  17.  
  18. mysql_close($con);
  19. ?>
-Frinny
Apr 28 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Vanessa | last post by:
I have an ASP script which is used to upload files with Persits.Upload.1 object. But I can't get the values from mutliple checkboxes in the form like normally. <form method="post"...
1
by: intscript | last post by:
Hi everyone Is is possible to retrieve data using multiple select. Here is my SQL code: select sum(nPassengers) Planned, Actual, (sum(Planned) - Actual) Variance from ( select iDeptCode,...
1
by: sonalpathak | last post by:
hi i m working on windows application using c#. i have to retrieve data from database in checkbox control but its giving the following error---cannot convert object to bool. the code i am typing...
1
by: feltra | last post by:
Hi, The following is from my friend who has only restricted net access from his office and hence cannot post.... ...
0
by: feltra | last post by:
Hi all, I am trying to export a GridView data to multiple file formats. The requirement is that when more than one file format is selected and the "Submit" button is clicked, the data from the...
0
by: TechnoAtif | last post by:
<?php include "dbconnect.php"; include "commonFunc.php"; ?> <!----------------------------------> <table width="80%" border="1" cellpadding="2" cellspacing="0"> <tr > <td...
11
by: TechnoAtif | last post by:
INSERT AND UPDATE MULTIPLE CHECKBOX DATA USING PHPMYSQL OR JAVASCRIPT Hi All I want to check the multiple checkboxes update them after revisiting that page. I am taking the name as...
6
by: mukeshrasm | last post by:
Hi I want to update records in database based on selected records using checkbox. if user does not select a record and clicks update button it should show the message please select record to be...
3
by: HTIDIRECT | last post by:
I am currently creating a form that requires me to have multiple comboboxes which have various options with different values. What I am having a problem with is finding a javascript snippet that...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.