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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:18:59+00:00 2026-05-28T04:18:59+00:00

I have a MySQL table with four columns, submited_name, submited_URL, submited_type, uniqueID . In

  • 0

I have a MySQL table with four columns, submited_name, submited_URL, submited_type, uniqueID. In this table i have about 1000 records. I need to select 10 random entries. The problem is that I need to split selected random values into separate PHP arrays. One for each column. My arrays should look something like this:

$ten_random_names = array ('name26', 'name55', 'name107', ect.);
$ten_random_URL = array ('url for name26', 'url for name55', 'url for name107', ect..);
$ten_random_types = array ('type for name26', 'type for name55', 'type for name107', ect..);
  • 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-28T04:18:59+00:00Added an answer on May 28, 2026 at 4:18 am
    $query = "SELECT *
              FROM tablename
              ORDER BY RAND()
              LIMIT 10";
    $result = mysql_query($query);
    
    $ten_random_names = $ten_random_URL = $ten_random_types = array();
    while ($row = mysql_fetch_assoc($result)) {
      $ten_random_names[] = $row['submited_name'];
      $ten_random_URL[] = $row['submited_URL'];
      $ten_random_types[] = $row['submited_type'];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MySQL query like this SELECT id,seq,text FROM table ORDER BY seq
I have a MySQL table with columns id, name and active. I need to
I have a MySQL table holding lots of records that i want to give
I have a simple mysql table with five columns: id: auto_increment (primary) id_symbol: INT(4)
I have a table for image gallery with four columns like: foid | uid
I seven columns in my MySQL table. Four of these are called A B
I need to retrieve data (vehicle details, in this case) from a MySQL table
I have a table with four columns: id, from, to, msg. The rows can
I have mysql table tmp with columns pid,city,state,country. I write queries so i can
Let's assume we have MySQL table events from which we'll select a data. Now

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.