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

  • Home
  • SEARCH
  • 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 3697244
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:50:11+00:00 2026-05-19T04:50:11+00:00

how take string from array define as new array, how to code in php

  • 0

how take string from array define as new array,
how to code in php

$column = array("id","name","value");

let say found 3 row from mysql

want result to be like this

$id[0] = "1";
$id[1] = "6";
$id[2] = "10";

$name[0] = "a";
$name[1] = "b";
$name[2] = "c";

$value[0] = "bat";
$value[1] = "rat";
$value[2] = "cat";

I want to take string from $column array define as new array.

how to code it?
or if my question is stupid , my please to have suggestion.

thank you.

  • 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-19T04:50:12+00:00Added an answer on May 19, 2026 at 4:50 am

    Answer I made on your previous question:

    $result = mysql_query($sql);
    $num = mysql_num_rows($result);
    $i = 0;
    
    if ($num > 0) {
      while ($row = mysql_fetch_assoc($result)) {
        foreach($row as $column_name => $column_value) {
          $temp_array[$column_name][$i] = $column_value;
        }
        $i++;
      }
    
      foreach ($temp_array as $name => $answer) {
        $$name = $answer;
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The program needs to take in a simple string from the user and display
My program will take arbitrary strings from the internet and use them for file
Take a string such as: In C#: How do I add Quotes around string
How can I take the string foo[]=1&foo[]=5&foo[]=2 and return a collection with the values
How do I take a string in Perl and split it up into an
I'd like to take a string such as this: [One, Two[A, B[i, ii, iii,
I am trying to take the string <BR> in VB.NET and convert it to
I need to be able to take a string like: '''foo, bar, one, two,
The basic idea is to take a string and evaluate it against an XML
I have the need to take a string argument and create an object of

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.