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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:38:23+00:00 2026-05-20T23:38:23+00:00

A friend of mine has asked me a question which i do not know

  • 0

A friend of mine has asked me a question which i do not know how.

The problem is he wants to use a result set of a query more than one time. Whenever he wants.

There is example tables and example output attached.

I will query two times only:

Select * from ornek1_ust
Select * from ornek1_alt

Is it possible to roam in a result set we already have with PHP to have some output like example output. I want to query database with full data for once. Then i want to use it wherever i want whenever i want.

Example Tables:

Database Table 1: ornek1_ust

Database Table 2: ornek1_alt

Example Output:

Example output

  • 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-20T23:38:23+00:00Added an answer on May 20, 2026 at 11:38 pm

    You’d want to “cache” the results within PHP. To fetch the data, you’d do a simple join query:

    SELECT ornek_ust1.isim AS ust, ornek1_alt.ism AS alt
    FROM ornek_ust1
    JOIN ornek1_alt ON ornek_ust1.id = ornek1_alt.ust_ID
    ORDER BY ornek_ust1.isim, ornek1_alt.ism
    

    and within PHP, do something like:

    $data = array();
    
    $sql = "SELECT ...";
    $res = mysql_query($sql) or die(mysql_error());
    
    while($row = mysql_fetch_assoc($res)) {
       $data[$row['ust'][] = $row['alt'];
    }
    

    which will build an array that looks like your desired data:

    $data = array(
        'ust data1' => array(
               0 => 'alt data 1'
               1 => 'alt data 2'
        ),
        'ust_data2' => ... etc...
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A friend of mine was asked the following question today at interview for the
Friend of mine has a problem :). There is an application written in Visual
A friend of mine has to use an internally-written Windows application to perform part
Recently a friend of mine has shown me a question as under declare @t
a friend of mine has a website and asked me to make some modifications
A friend of mine has a problem with his wordpress blog. When you watch
This is a problem a friend of mine has. He has a table keyword
A friend of mine has inherited an old Joomla 1.0.x site, that amongst other
A friend of mine has to send a normal email using ONLY HTML/HTML5 (or
A friend of mine was asked, during a job interview, to write a program

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.