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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:12:30+00:00 2026-06-15T18:12:30+00:00

Hello I’m checking duplicated data from tables. I have a problem that from where

  • 0

Hello I’m checking duplicated data from tables. I have a problem that from where data selected. My code is:

$sub_cat = array(); 
$select = array("core_network","daisy_chain", "rf_bts", "rf_power", "rf_transmission");
$d='0';
for ($i=0;$i<=4;$i++){
    $SQL = "SELECT sub_cat FROM (".$select[$i].") WHERE location=('".$id."')";
    $result = mysql_query($SQL);

    $cs=$d;

    if ($result) {
        while ($db_field = mysql_fetch_array($result)) {
            if(!in_array($db_field['sub_cat'],$sub_cat)) {
                $sub_cat[]= $db_field['sub_cat'];
                $cs++;
                $d=$cs;
                $d--;
            }
        }
    } 

I need to know that sub_cat selected from which $select[i]. How to find it?

  • 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-15T18:12:31+00:00Added an answer on June 15, 2026 at 6:12 pm

    To get the values, do this:

    $sub_cat = array(); 
    $select = array("core_network","daisy_chain", "rf_bts", "rf_power", "rf_transmission");
    $d='0';
    for ($i=0;$i<=4;$i++){
        $SQL = "SELECT sub_cat FROM (" . $select[$i] . ") WHERE location=('".$id."')";
        $result = mysql_query($SQL); // deprecated - use PDO
    
        $cs = $d;
    
        if ($result) {
            while ($db_field = mysql_fetch_array($result)) {
                if(!in_array($db_field['sub_cat'], $sub_cat)) {
                    $table = $select[$i];
                    $sub_cat[$table][] = $db_field['sub_cat'];
    
                    // I have no clue what's going on here in your example:
                    $cs++;
                    $d=$cs;
                    $d--;
                }
            }
        } 
    }
    

    Then, to retrieve it:

    foreach ($sub_cat as $table_name => $values) {
        foreach ($values as $row) {
            // output values here
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I have this problem with PyQt4-dev-tools that include: * a user interface compiler
Hello I currently face a problem were I want to output data from 2
Hello I have the next strange problem: I recover the coordinates from a sql
Hello I have like this 2 tables class User public int UserId{get;set;} { ....
Hello i have this code var queue = new BlockingCollection<int>(); queue.Add(0); var producers =
Hello guys I need to pass a string array over to a setter that
Hello I have the following script in PHP: $correct = array(a, a, a, a);
Hello everyone how can I get two values from different select boxes? I get
hello i have a desktop application that communicate with a wcf service that i
Hello guys i have a small problem at my console application i have a

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.