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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:18:38+00:00 2026-05-31T11:18:38+00:00

Currently I have the following table in my database |AnswerID|QuestionID|AnswerText| |21|2|User| |22|2|Admin| |23|2|Guest| |24|2|User2|

  • 0

Currently I have the following table in my database

|AnswerID|QuestionID|AnswerText|
|21|2|User|
|22|2|Admin|
|23|2|Guest|
|24|2|User2|

and written the following php script

$questionID=0;
while ($list = mysql_fetch_assoc($result)) 
{
echo $list['QuestionID'] . ":" . $list['QuestionText'] . "<br/>";  
$questionID=$list['QuestionID'];
}
$optionsquery="SELECT AnswerText,AnswerID FROM Options Where QuestionID=".$questionID;
$optionsresult=mysql_query($optionsquery) or die ('Query failed:'. mysql_error());
while($row = mysql_fetch_array($optionsresult))
{
  'Display the multiple choices 
   associating the AnswerID with the appropriate AnswerText.' 

   E.g. echo "<input type='radio' name='QuestionID'     
              value='AnswerID'/>" 
              corresponding AnswerText given the AnswerID;

   E.g for the first radio button:

   echo "<input type='radio' name='2' value='21'/> User;

}

Could I get help with the PHP syntax for the radio buttons?

  • 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-05-31T11:18:39+00:00Added an answer on May 31, 2026 at 11:18 am

    You could do:

    echo "<input type='radio' id='radio-" . $row["QuestionID"] . "-" . $row["AnswerID"] . "' name='" . $row["QuestionID"] . "' value='" . $row["AnswerID"] . "' /> <label for='radio-" . $row["QuestionID"] . "-" . $row["AnswerID"] . "'>" . $row["AnswerText"] ."</label><br/>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have the following code coming from a database table: <h1 class=widgetHeader>My Friends</h1>
I currently have the following row in my table: course_data: user_id days <-- This
Assuming you have the following database table: create table Names ( Id INT IDENTITY
I currently have the following funciton in an oracle database that returns a concatenated
We have a database, that through a hiccup in a script, has one table
I have the following data: User System SubSystem user1 System1 SubSystem1 user2 System1 SubSystem2
P.S. I am new to php & webform scripting; Currently I have the following
I have the following translation table in an oracle 10g database: ID VARCHAR2(100 BYTE)
I currently have a MySQL database with a table that has a field that
The Scenario: I have the following (simplified) database table scenario: ID ProductName ProductCategory Colour

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.