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.
How to retrieve data based on multiple checkbox selections
Collapse
X
-
Tags: None
-
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 -
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.Comment
-
Comment
-
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:
-FrinnyCode:<?php $con = mysql_connect("localhost","peter","abc123"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("my_db", $con); $result = mysql_query("SELECT * FROM Persons"); while($row = mysql_fetch_array($result)) { echo $row['FirstName'] . " " . $row['LastName']; echo "<br />"; } mysql_close($con); ?>Comment
Comment