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

  • Home
  • SEARCH
  • 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 8886383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:32:44+00:00 2026-06-14T21:32:44+00:00

I am new at PHP/SQL so bear with me if I say something that’s

  • 0

I am new at PHP/SQL so bear with me if I say something that’s obvious or downright wrong.
I have a SQL table (in a database) and I need to take 3 random values (name, race, year), each from a different field in the table, and print it on a website with php. The value requirement “race” will be different depending on radiobuttons (lets say RB1, and RB2) and this all has to happen when

<input type="submit" name="button"> is clicked.

<html>  <input type="radio" name="RB1"> Asian  </html>

What could I do in this situation?

Example: So if RB1 is selected and the button is clicked I will need to randomly print a “name” with the corresponding “year” (of the name) and it should have a corresponding race of RB1 (which is Asian)

  • 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-14T21:32:45+00:00Added an answer on June 14, 2026 at 9:32 pm

    I think this code will help you to understand this-

    DB thing, you have to take care for that..im giving you an idea to handle this sort of stuff.

    Create one test.php file(this what i did)

    Place this code —

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>index</title>
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
    $("input:radio[name=race]").change(function(){
    $.ajax({
    type : 'GET',
    url : 'getdata.php',
    data: {race : $('input:radio[name=race]:checked').val()},
    success: function(data){
    $('#showdata').html(data);
    },
    });
    });
    });
    </script>
    </head>
    
    <body>
    
    <form action="#" method="post" name="myform">
    <input type="radio" name="race" value="RB1" /> Asian
    <input type="radio" name="race" value="RB2" /> European 
    </form>
    
    <div id="showdata"></div>
    
    </body>
    </html>
    

    In getdata.php file paste this content –

    <?php
    
    $myvalue = $_GET['race'];
    
    if( $myvalue == 'RB1')
    {
    echo "I am RB1";
    }
    if( $myvalue == 'RB2')
    {
    echo "I am RB2";
    }
    

    Run the code in browser now (test.php).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, so im new in php and sql, and I have this form that
I'm new to php and sql. I have a table with three columns. One
I'm new to PHP and SQL, so this is something of a big bite
I am new to php and sql, and i have one tiny question about
I'm new to PHP and SQL, but I need a way to store the
I am pretty new to both php and SQL. I have a login page
I made an SQL database that with when I call this http://drymvizion.atwebpages.com/new_score.php?=pa&name=eleni&scor=23400 in explorer,
im very new to this and have a very basic knowledge php and SQL
I'm new at PHP and SQL, so I was playing around with this table
Disclaimer: I am completely new to PHP and MySQL/SQL. I have multiple implode() functions

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.