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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:36:16+00:00 2026-06-16T01:36:16+00:00

My code is: $query = SELECT a.hash, a.full, a.partial, a.servers, a.lastupd, b.full, b.partial, b.servers,

  • 0

My code is:

$query = "SELECT a.hash, a.full, a.partial, a.servers, a.lastupd, b.full, b.partial, b.servers, b.lastupd FROM table1 AS a, table2 AS b WHERE a.hash='".$hashcode."' AND a.hash=b.hash;";
$result = mysql_query($query);

then I perform a

print_r(mysql_fetch_array($result));

And I get this weird output:

Array
(
    [0] => blah
    [hash] => blah
    [1] => 1,1,1
    [full] => 0,1
    [2] => 1,2,1
    [partial] => 4,2
    [3] => srv1,srv2,srv3
    [servers] => srv2,srv3
    [4] => 0000-00-00 00:00:00
    [lastupd] => 0000-00-00 00:00:00
    [5] => 0,1
    [6] => 4,2
    [7] => srv2,srv3
    [8] => 0000-00-00 00:00:00
)

Why there’s data repetition for b table and doesn’t create an associative array with keys a.* and b.*?

Note: the timestamps set to 0 are correct

  • 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-16T01:36:18+00:00Added an answer on June 16, 2026 at 1:36 am

    Because mysql_fetch_array returns both associative and numeric array. Use mysql_fetch_assoc, if you only need associative array.

    (By the way, mysql is deprecated, read about using mysqli or PDO)

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

Sidebar

Related Questions

The following query: select unnest(Table2.L) as X, unnest(Table1.O) from Table1, Table2 where Table1.code =
This is my code: $query = mysql_query(SELECT * FROM books ORDER BY id) or
I have the following code: (query added) $weight_table = mysql_query (SELECT * FROM .$prefix.weight
now i use this code: $welcome_text = mysql_query(SELECT * FROM `text` WHERE `name` =
I currently am trying the following code: $sql = $db->query(select id,username,fullname from userss ORDER
I am creating a chunk of HTML/JavaScript with the below code: $result = mysql_query(SELECT
Assuming A.sql contains the following code, then second Select query won’t be executed due
I am trying to code the following query using Zend_Db api's: select * from
I have this code: _q = db.Query(SELECT * FROM Area WHERE suburb_town_lower == :1,
I have the following line of code : mysql_query(SELECT name FROM details WHERE md5(name)

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.