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 8555937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:14:21+00:00 2026-06-11T15:14:21+00:00

I have a form that searches my local database. Its still in its production

  • 0

I have a form that searches my local database. Its still in its production phase. However when I try to get the value of my radio button there is nothing. Below is the code:

PHP

$k = $_GET['k'];
$terms = explode(" ", $k);
$query = "SELECT * FROM  series8000 WHERE ";
$vision = $_GET['Vision'];
$new = $_GET['new1'];
$sithelo = sithelo;
foreach ($terms as $each) {
    $i++;
    if ($i == 1)
        $query .= "Description LIKE '%$each%' ";
    else
        $query .= "OR Description LIKE '%$each%' ";
}   
$query .= "AND VisionType = '$vision' ";

if (!empty($new1 )) {
    $query .= "AND Change = '$new1' ";
}

HTML

<form action='index.php' method='get'>
<fieldset>


                <legend>Change</legend> 


                    <label for="New" class="property">New Product</label>
                    <div class="labels">
                        <input type="radio"  name="new1" <?php if (isset($new1) && $new1 == "N") echo "checked=yes"; ?>size="30" value="N"/>
                        <input type="radio"  name="new1" size="30" value="Y"/>
                        <input type="radio"  name="new1" size="30"  value="YN"/>&nbsp;&nbsp;
                    </div>  

                    <div style="clear: both;"></div>

The challenge is the value of the radio button with name new1 comes blank when I echo in my php code not shown here. I have to get the value of the radio button so that i can use it in my query.

  • 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-11T15:14:22+00:00Added an answer on June 11, 2026 at 3:14 pm

    You put the value of new1 in a variable $new but you don’t seem to use it when it comes to this line:

    if (!empty($new1 )) {
        $query .= "AND Change = '$new1' ";
    }
    

    Try perhaps with:

    if (!empty($new)) {
        $query .= "AND Change = '$new' ";
    }
    

    And also use what Kalai said:

     echo "checked='checked'";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a search form that searches a table in my database. The table
I have a form that searches a MySQL database using PHP. Currently, when a
I have a php form that searches a SQL database. There are say eight
I have a simple form that searches through the 2000+ issues of a 3rd
I have a form that sends money value e.g <input type=text name=amount value=N50,000.00 NGN
I have written a simple mysql search form that searches between two dates. This
I am creating a multi-form search box that searches a Meat packaging database. The
I have a project that requires a search form that searches two separate eBay
I have an application that searches a database of addresses. The page visitor enters
I have a form that searches a mysql db for whatever the user is

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.