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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:56:54+00:00 2026-06-09T07:56:54+00:00

how do i get the relation between the two array when both of them

  • 0

how do i get the relation between the two array when both of them have values in some relation on the same indexes of both array for example,

i have retrieved “tagname” and “path” from one table of mysql and then i put these two column values in two arrays using loop so “array Tag[]” have vale “Introduction” and “array Path[]” have path value for introduction both values are on index “0” of there respected array and all data is collecten in “arrat Tag[]” and “array Path[]” in this manner after that i sort my “Tag” according to some other array using this code,

$sorted =array_intersection($some_other_array,$array Tag)

now how would i know the related path values for Tag as tag sorted ??

Hopes for your suggestions

  • 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-06-09T07:56:57+00:00Added an answer on June 9, 2026 at 7:56 am

    from mysql/DB result set when you are creating array, create as

    while($row = mysql_fetch_assoc($query)){
        $array[$row['path']] = $row['tag'];
    }
    

    assuming your array as

    $array['xyz'] = 'pqr';
    $array['abc'] = 'wsx';
    $array['poi'] = 'qaz';
    $array['lkj'] = 'abc';
    

    sort your array as per need based on tag or sorting methods available.
    in this case instead of int index it will have key as path
    sorting with tag also binds it with path.

    after sorting your array (assuming sorting with first letter alphabates of tag name)

    $array['lkj'] = 'abc';
    $array['poi'] = 'qaz';
    $array['xyz'] = 'pqr';
    $array['abc'] = 'wsx';
    

    so you can easily find path for your tag with foreach loop with key and value or with aray_keys if you want particular tag path and you know the tag value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables with one_to_one relation between them Table one: User - has
I have two tables with a weak relation. I need get a text value
I have a legacy data base and a relation one-to-one between two tables. The
I have two tables, let's call them table1 and table2 . They both have
When i have a relation between two entities in my model: [GroupMember] (*) -----
I've two entities with 1 to N relation in between. Let's say Books and
I’m having some difficulties with two queries. I can get some of the information
Ok so i have two models: 1: pv_array (photovoltaic array) 2: module (photovoltaic module)
I have a many to many relationship between some Jobs and some Workers. Each
I have a simple one-to-many (models.ForeignKey) relationship between two of my model classes: class

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.