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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:54:37+00:00 2026-05-21T11:54:37+00:00

In MySQL the table test looks like this: id name lft rgt 1 Folder

  • 0

In MySQL the table test looks like this:

id  name         lft      rgt
1   Folder 1        1          10
2   Child 1         2           3
3   Child 2         4           7
4   Child 1         5           6
5   Child 3         8           9

When I do:

$results = mysql_query("SELETCT * FROM test ORDER BY id");
$fetch = mysql_fetch_array($results);

echo "<pre>";
echo print_r($fetch);
echo "</pre>;

The result is:

[0] => 1
[id] => 1
[1] => Folder 1
[name] => Folder 1
[2] => 1
[lft] => 1
[3] => 10
[rgt] => 10

My question is why [0] => 1, [1] => Folder 1, 2] => 1 and [3] => 10 are there? As I see they are somehow linked with the original rows, maybe these are the indexes for them but how should I get rid of them?

  • 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-21T11:54:37+00:00Added an answer on May 21, 2026 at 11:54 am

    mysql_fetch_array() has three modes of retrieving data. The default is MYSQL_BOTH, which is what you’re seeing – a combo hash+array structure. The other two modes are array-only (MYSQL_NUM) and hash-only (MYSQL_ASSOC).

    In other words, these are direct 1:1 correspondence in fetch modes:

    mysql_fetch_array($results, MYSQL_NUM) === mysql_fetch_row($results)
    mysql_fetch_array($results, MYSQL_ASSOC) === mysql_fetch_assoc($results)
    mysql_fetch_array($results)  === mysql_fetch_array($results, MYSQL_BOTH) // default mode.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example, I have a table which looks like this : id | name
I've got a MySQL table that looks like this: CREATE TABLE my_facts ( `id`
I have created a test table in MySQL and would like to insert 10
I have mysql database structure like below: CREATE TABLE test ( id int(11) NOT
Using MySQL 5 I have a table like this: date (varchar) door (varchar) shift
HI, I have a problem with this query SELECT * FROM table WHERE `name`
My table structure looks like this: tbl.users tbl.issues +--------+-----------+ +---------+------------+-----------+ | userid | real_name
I am a bit lost, this looks like some silly mistake - but I
my CSV content looks like this 1234,123;123;123 5675,123;567;234;565 No Space is provided at the
I have a table called products in a MySQL database. products looks some what

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.