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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:04:31+00:00 2026-06-04T12:04:31+00:00

I want to create simple poll system. I have two question and two answers.

  • 0

I want to create simple poll system. I have two question and two answers. First Question has two answer but second question hasn’t any answer. In a sense I want to get:

First question?
Answer1
Answer2

Second question?

But I’m getting

First question?
Answer1
Answer2

Second question?
Answer1 
Answer2

Second question need not to have Answer1 and Answer2(same with First question answers but I have two answer in mysql).

And my foreach loops.. How need i to change my loops?

foreach($sorular->soruCek($_GET["kategori"]) as $data) // Questions
{
    echo $data["soru"] . "<br/>";
    foreach($sorular->cevapCek($data["id"]) as $cevaplar) // Answers
    {
        echo $cevaplar["cevap"] . "<br/>"; // This needn't print data to below of Second Question
    }
}
  • 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-04T12:04:32+00:00Added an answer on June 4, 2026 at 12:04 pm
    foreach($sorular->soruCek($_GET["kategori"]) as $data)
    {
        $inner_data = $sorular->cevapCek($data["id"]);
    
        if ($inner_data) {
            echo $data["soru"] . "<br/>";
    
            foreach($inner_data as $cevaplar)
            {
                echo $cevaplar["cevap"] . "<br/>";
            }
        }
    }
    

    You have to fetch the data inside the inner loop first, make sure it has values before printing the – what I assume is – a header?

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

Sidebar

Related Questions

I want to create simple login system using the SQLLIte I have created the
I want to create a simple user registration form with First / Last name,
I want to create simple form using CForm (yii framework) but 'elements' => array('username'=>array('type'=>'text'))
I want to create simple application like android image gallery but I don't want
I want to create simple dummy tag which can work with Struts2. I have
So... I want to create simple HTTP Chunked transfer encoding prototype. I have messages
I want to create simple utility class that has no visual elements and create
JavaScript. I want to create simple script, that will be resize loaded image using
I want to create a simple http proxy server that does some very basic
I want to create a simple box with a header bar containing a title

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.