Jump to content

Search the Community

Showing results for tags 'arrays looping for each'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Please excuse my terrible ability to explain what I'm trying to do, my aim is to draw questions and answers from a database to be output in flash. My problem is: I have created an array listing all of the question ids for a particular quiz, I would like to create another array that lists all the enteries in the database that have those id's so far I have managed to create an array which shows the last ID's answers. what i want is to create 8 seperate arrays not just one? foreach ($quesid as $id) { $sql = mysql_query("select answer FROM answers WHERE question_ID= $id "); $answers = array(); while($row =mysql_fetch_row($sql)) { $answers[] = $row[0]; } } print_r ($answers); echo "questions=" . $question."&"; print_r ($quesid); here is what is output: Array ( [0] => Bulgaria [1] => Nicaragua [2] => Albania [3] => Romania ) questions=The ‘Sea Swallow’ is an alternative name for which bird?/In which sport would you see a ‘Western Roll’?/Who is better known as ‘Herbert Khaury’?/'Diet' is the parliament of which country?/What is the real first name of Coco Chanel?/'The Aztecs' were natives of which country?/What was invented by‘O.A. North’ in 1869?/King Zog was the ruler of which country?&Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 ) the first array is what i need but i need it 7 other times.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.