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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:21:35+00:00 2026-05-28T16:21:35+00:00

Any help is appreciated. I have an array that is forfetch like this. The

  • 0

Any help is appreciated.
I have an array that is forfetch like this. The reason is to brake down a product in individual arrays. However I can not figure out what statement to put in the while loop so i can loop through each array in $row. initially the statement should be

 while ($row = mysql_fetch_assoc($result)) 

however this was already done to be able to sort the array.

$sorted = array_orderby($newarray, 'volume', SORT_DESC, 'edition', SORT_ASC);


foreach($sorted as $row)
{

    while(  ???????   )

{
    $row = build_items($row);



        $template->assign_block_vars('featured_items', array(
            'ID' => $row['id'],
            'IMAGE' => $row['pict_url'],
            'TITLE' => $row['title'],
            'SUBTITLE' => $row['subtitle'],
            'BUY_NOW' => ($difference < 0) ? '' : $row['buy_now'],
            'B_BOLD' => ($row['bold'] == 'y')
        ));
        $k++;
        $feat_items = true;
    }
}

Just found the answer. Sorry guys im new at PHP.

   foreach($sorted AS $row) {


        $row = build_items($row);

        // time left till the end of this auction 
        $s_difference = time() - $row['starts'];
        $difference = $row['ends'] - time();
        $bgcolour = ($k % 2) ? 'bgcolor="#FFFEEE"' : '';

        $template->assign_block_vars('featured_items', array(
            'ID' => $row['id'],

            'IMAGE' => $row['pict_url'],
            'TITLE' => $row['title'],
            'SUBTITLE' => $row['subtitle'],
            'BUY_NOW' => ($difference < 0) ? '' : $row['buy_now'],
            'BID' => $row['current_bid'],
            'BIDFORM' => $system->print_money($row['current_bid']),
            'TIMELEFT' => FormatTimeLeft($difference),
            'NUMBIDS' => $row['num_bids'],

            'B_BOLD' => ($row['bold'] == 'y')
        ));
        $k++;
        $feat_items = true;

}
  • 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-28T16:21:36+00:00Added an answer on May 28, 2026 at 4:21 pm
    foreach($sorted AS $rows) {
      foreach($rows AS $row) {
      ...
      }
    }
    

    or with keys/indices

    foreach($sorted AS $key => $rows) {
      foreach($rows AS $index => $row) {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Any help here would be greatly appreciated. I have this table hospital Nurse |
I have an array with multiple sub-arrays like this: Array ( [0] => Array
I have an array that gets created from JSON. The array looks like this:
i have an array of card types that looks something like this var cards
I have an array that looks like this: PHP Syntax (Toggle Plain Text) array
I am new to jQuery. Any help would be appreciated I have two radio
Long time reader, first time poster. Any help is greatly appreciated. I have crafted
Any help most appreciated, this is driving me insane. I'm doing exactly what I
I'm very new to this, so any help is appreciated. I'll use the Dinners/RSVPs
I am new to RoR, any help would be greatly appreciated :) I have

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.