Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8560749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:20:53+00:00 2026-06-11T16:20:53+00:00

I have this page (code below) which contains a series of 5 checkboxes, all

  • 0

I have this page (code below) which contains a series of 5 checkboxes, all representing different values, and i need to use them to query a database.

<form id="form1" name="form1" method="post" align="center" action="section_search_results1.php">
      <p>Select The <b>Section</b> You Wish To Search In Below...      </p>
      <p>
        <label for="section"></label>
        <label for="section2"></label>
        <label>
          <input type="checkbox" name="SectionSelect" value="Functional" id="SectionSelect_0" />
          Functional</label>
        <label>
          <input type="checkbox" name="SectionSelect" value="Technical" id="SectionSelect_1" />
        Technical</label>
        <label>
          <input type="checkbox" name="SectionSelect" value="Commercial" id="SectionSelect_2" />
        Commercial</label>
        <label>
          <input type="checkbox" name="SectionSelect" value="Implementation" id="SectionSelect_3" />
        Implementation</label>
        <label>
          <input type="checkbox" name="SectionSelect" value="Innovation" id="SectionSelect_4" />
        Innovation</label>
        <br />
      </p>
      <p>Enter the <b>Keyword(s) or Keyphrase</b> Below...</p>
      <p>
        <label for="kword"></label>
        <input type="text" name="kword" id="kword" placeholder="Enter Keyword(s)" />
        <br />
      </p>
      <p>
        <input type="submit" name="submit" id="submit" value="Search" /> | | <input type="reset" name="clear" id="clear" value="Clear" />
      </p>
    </form>

as you can see each has its own value which is the term used to query the database. the php query code on the results page is as follows

    <?php
          $kword = $_POST["kword"];
          $section = $_POST["SectionSelect"];

          function boldText($text, $kword) {
        return str_ireplace($kword, "<strong>$kword</strong>", $text);
    }


       // Connects to your Database 
     mysql_connect("localhost", "root") or die(mysql_error()); 
     mysql_select_db("test") or die(mysql_error()); 
     mysql_real_escape_string($kword); 
     $data = mysql_query("select company_name, section_name, question, answer from company, rfp, section, question_keywords
    where company.company_id = rfp.company_id
    and rfp.rfp_id = question_keywords.rfp_id
    and question_keywords.section_id = section.section_id
    and section_name like '%$section%'
    and keywords like '%$kword%';") 
     or die(mysql_error());
?>

ultimately what i want this to do is to query the database with the query to potentially have where clauses for each of the checkbox values? for example i want to select x where y like ‘Technical’ AND y like ‘Functional’ and so on…

Any help would be great

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:20:55+00:00Added an answer on June 11, 2026 at 4:20 pm

    Set up your checkbox names as array-keys to use them as an array with values of all selected checkboxes:

    <input type="checkbox" name="SectionSelect[0]" value="Functional" />
    <input type="checkbox" name="SectionSelect[1]" value="Technical" />
    
    echo $_POST['SectionSelect'][0]; // should print "Functional"
    echo $_POST['SectionSelect'][1]; // should print "Technical"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On my main page I have this jquery code which does an ajax call
I have a textarea which already contains some content (haml code below) //haml code
I have this piece of code: Page.ClientScript.RegisterClientScriptInclude(this.GetType(), Guid.NewGuid().ToString(), this.ResolveUrl(~/Scripts/min.js)); When we push to our
I have this jQuery code in my JSP page (jQuery 1.7.2) : function Header()
I have this code that fetches some text from a page using BeautifulSoup soup=
I have this code require 'mechanize' @agent = Mechanize.new page = @agent.get('http://something.com/?page=1') next_page =
i have this simple code to load data from other php page using get
Say I have this code in my page: <script language=javascript> $(document).ready(function() { $(.test).click(function() {
I have 2 master pages that are nested.this is main master page code for
In code-behind of an ASP.NET page I have this method: public string TestFunc() {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.